This version is in beta - expect some breaking changes.

Create Test User API

Version and status
Available in Sandbox Yes
Sandbox base URL https://test-api.service.hmrc.gov.uk
Available in Production No

Overview

Use this API to create test users for testing in our sandbox with user-restricted endpoints.

What is a test user?

A test user is a dummy Government Gateway account that you can use for testing in our sandbox. To access user-restricted endpoints your application’s users must complete the OAuth journey, which includes signing into their Government Gateway account.

Each test user has a:

  • type of Government Gateway account - individual, organisation or agent
  • Government Gateway user ID and password - for sign in during the OAuth journey
  • set of service enrolments and related tax identifiers - as different APIs require different enrolments

What types of test user can I create?

With this API you can create a wide range of test users, including individuals, organisations and agents together with a wide variety of service enrolments and corresponding tax identifiers. You can also create test users for use during automated testing.

You can also use our create a test user service to create test individuals or organisations with a simpler default set of enrolments.

How long does a test user last?

Test users and other test data are no longer cleared down every two weeks.

Errors

Testing

Versioning

Endpoints

View API endpoints
Why do these endpoints look different?

The endpoints for this API now use the Open API Specification (OAS).

The API has not changed. You do not need to make any updates to your application if you already use this API.