UK Share Code API Logo

UK 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://app.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

/rtr

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

code (Required)

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

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)

checker_type (Required)

Specify whether you're a 'landlord' or an 'agent'.

checker_name (Required)

Your name (if checker_type is set to 'landlord'), or your company name (if checker_type is set to 'agent')

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”).

/rtw and /v2/rtw

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

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”).

include_pdf (Optional)

Include the official pdf report containing all of the right to work information in the response. Returned as a (very long) base64 encoded string. Can be set to "true" or "false". (default: "false")

/immigration (beta)

Validate an individual's immigration status.

code (Required)

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

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.

checker_job_title (Required)

The job title of the person(s) carrying out the check, for example, 'HR Manager'

check_reason (Required)

The reason that the check is being carried out, must be set to one of the below constants:

DRIVING_LICENCE - To check if the individual is eligible for a driving licence

LOAN - To check if the individual is eligible for a student loan

EDUCATION_OR_TRAINING - To check if the individual is eligible for education or training

TRAVEL - To check if the individual is eligible for travel

HEALTH_INSURANCE_CARD - To check if the individual is eligible for a health insurance card

PERSONAL_FINANCE - To check if the individual is eligible for personal finance (including bank and building society accounts, loans, credit cards and mortgages)

HOMELESSNESS_ASSISTANCE_OR_COUNCIL_HOUSING - To check if the individual is eligible for homelessness assistance or council housing

OTHER - Another Reason

check_reason_other (Optional)

A string detailing the reason for the check, this is required if check_reason is set to 'other'.

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”).

include_pdf (Optional)

Include the official pdf report containing all of the individual's immigration information in the response. Returned as a (very long) base64 encoded string. Can be set to "true" or "false". (default: "false")

/usage

If you have a subscription, this shows you how many checks that you have performed in the current payment period.

/credit_pack

Returns all active credit packs associated with the account.

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. (Please note that these definitions will hold true for V2 also, but the formatting may be different.).

govuk_check_details

Get the check date, company name and check reference number associated with the gov.uk check.

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/rent 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)

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

REJECTED - Right to Work/Rent not verified, code found but failed some configured parameters/conditions.

NOT_FOUND - Share code not valid

SHARE_CODE_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.

SHARE_CODE_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/Rent is valid from, formatted as dd-mm-yyyy.

title

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

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 (/rtw, /v2/rtw, /rtr, /immigration)

Mock the response for a valid share code.

TEST_NOT_FOUND (/rtw, /v2/rtw, /rtr, /immigration)

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

TEST_NAME_MISMATCH (/rtw, /v2/rtw, /rtr, /immigration)

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

TEST_SPONSOR (/rtw, /v2/rtw)

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 (/rtw, /v2/rtw)

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 (/rtw, /v2/rtw, /rtr)

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

TEST_LOCKED (/rtw, /v2/rtw, /rtr, /immigration)

Mock the response for a share code that has been locked.

Select Language:

Select Endpoint:

Request

import requests url = "https://app.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)

Response

{ "code": 200, "status": { "conditions": "N/A", "govuk_check_details": { "check_date": "16 June 2025", "company_name": "UK Share Code API", "reference_number": "WE-G98V497-OI" }, "details": "They have permission to work in the UK until 30 March 2028", "expiry_date": "30/03/2028", "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD +wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII", "pdf": "JVBERi0xLjEKMSAwIG9iajw8IC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+PmVu ZG9iagoyIDAgb2JqPDwgL1R5cGUvUGFnZXMvS2lkc1szIDAgUl0vQ291bnQgMT4+ ZW5kb2JqCjMgMCBvYmo8PCAvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJv eFswIDAgMSAxXS9Db250ZW50cyA0IDAgUj4+ZW5kb2JqCjQgMCBvYmo8PCAvTGVu Z3RoIDA+PnN0cmVhbQplbmRzdHJlYW0KZW5kb2JqCnhyZWYKMCA1CjAwMDAwMDAw MDAgNjU1MzUgZiAKMDAwMDAwMDAwOSAwMDAwMCBuIAowMDAwMDAwMDUzIDAwMDAw IG4gCjAwMDAwMDAxMDMgMDAwMDAgbiAKMDAwMDAwMDE3OCAwMDAwMCBuIAp0cmFp bGVyPDwgL1Jvb3QgMSAwIFIgL1NpemUgNT4+CnN0YXJ0eHJlZgoyMjMKJSVFT0YK ", "name": "JOHN DOE", "outcome": "ACCEPTED", "start_date": "08/02/2025", "title": "Right to work" }}

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.