---
schema_version: "1"
id: 06195ccf47c7e591fe4cee6b3a980367b8ad841c3d4998e76b102a428d42c974
title: REST Resources for Unit Testing
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_tooling/intro_rest_resources_testing.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/intro_rest_resources_testing.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: c2a001e85fe49ee00334f1f4418bb098a3f7225433c5bcb2954aeb08f2f4b3b5
description: Retrieve and execute Apex and flow tests in one place. Get a complete view of your tests by using the Test Discovery API. Execute tests asynchronously or synchronously by using the Test Runner API. These APIs are both Tooling API REST resources.
---
# REST Resources for Unit Testing

Retrieve and execute Apex and flow tests in one place. Get a complete view of your tests by using the Test Discovery API. Execute tests asynchronously or synchronously by using the Test Runner API. These APIs are both Tooling API REST resources.

![Note](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/images/icon_note.png)

#### Note

The Test Discovery API and Test Runner API support only flow tests created with [automated flow testing](https://help.salesforce.com/s/articleView?id=platform.automate_flow_test_record_data_cloud_triggered.htm&type=5&language=en_US) in Flow Builder.

The base URI for these Tooling API REST resources is https://domain/services/data/vXX.X/tooling/ where **domain** is your org’s My Domain login URL and vXX.X is the API version number. For example: https://MyDomainName.my.salesforce.com/services/data/v68.0/tooling/

- **[Retrieve Unit Tests](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/intro_rest_resources_testing_discovery.htm)**  
    The Test Discovery API returns details about Apex and automated flow tests. This resource is available in Tooling API version 65.0 and later.
- **[Run Unit Tests Asynchronously](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/intro_rest_resources_testing_runner_async.htm)**  
    Use the Test Runner API to execute Apex and flow tests asynchronously. Available for Apex tests in API version 30.0 and later. Available for automated flow tests in API version 65.0 and later.
- **[Run Unit Tests Synchronously](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/intro_rest_resources_testing_runner_sync.htm)**  
    Use the Test Runner API to execute one or more Apex or flow tests synchronously. All test methods in a synchronous test run must be in the same class. Available for Apex tests in API version 30.0 and later. Available for automated flow tests in API version 65.0 and later. In API version 40.0 and later, running Apex tests synchronously using the POST method for /runTestsSynchronous/ requires the View Setup user permission.