Skip to main content
GET
/
module
/
tests
/
{testRunId}
Get Module Test Run by ID
curl --request GET \
  --url https://api.env0.com/module/tests/{testRunId} \
  --header 'Authorization: Basic <encoded-value>'
{
  "status": "IN_PROGRESS",
  "blueprintRevision": "<string>",
  "prNumber": "<string>",
  "startedBy": "<string>",
  "startedByUser": {
    "email": "<string>",
    "user_id": "<string>",
    "created_at": "<string>",
    "app_metadata": {},
    "picture": "<string>",
    "name": "<string>",
    "last_login": "<string>",
    "given_name": "<string>",
    "family_name": "<string>"
  },
  "createdAt": "2023-11-07T05:31:56Z",
  "queuedAt": "2023-11-07T05:31:56Z",
  "startedAt": "2023-11-07T05:31:56Z",
  "finishedAt": "2023-11-07T05:31:56Z",
  "error": {},
  "customEnv0EnvironmentVariables": {
    "environmentId": "<string>",
    "projectId": "<string>",
    "projectName": "<string>",
    "deploymentLogId": "<string>",
    "deploymentType": "deploy",
    "deploymentRevision": "<string>",
    "workspaceName": "<string>",
    "rootDir": "<string>",
    "organizationId": "<string>",
    "templateId": "<string>",
    "templateDir": "<string>",
    "templateName": "<string>",
    "environmentName": "<string>",
    "environmentCreatorName": "<string>",
    "environmentCreatorUserId": "<string>",
    "environmentCreatorEmail": "<string>",
    "deployerName": "<string>",
    "deployerUserId": "<string>",
    "deployerEmail": "<string>",
    "reviewerName": "<string>",
    "reviewerEmail": "<string>",
    "reviewerUserId": "<string>",
    "vcsProvider": "gitlab",
    "prAuthor": "<string>",
    "prNumber": "<string>",
    "prSourceRepository": "<string>",
    "prSourceBranch": "<string>",
    "prTargetBranch": "<string>",
    "commitHash": "<string>",
    "commitUrl": "<string>",
    "oidcToken": "<string>",
    "vcsAccessToken": "<string>",
    "tfPlanJson": "<string>",
    "cliArgsPlan": "<string>",
    "cliArgsApply": "<string>"
  },
  "gitAvatarUrl": "<string>",
  "gitUser": "<string>",
  "blueprintRepository": "<string>",
  "id": "<string>",
  "deploymentLogId": "<string>",
  "environmentId": "<string>",
  "organizationId": "<string>",
  "triggerName": "user",
  "testSummary": {
    "passed": 123,
    "failed": 123,
    "skipped": 123,
    "errored": 123
  },
  "testFilesResults": {},
  "moduleId": "<string>"
}

Authorizations

Authorization
string
header
required

env0 API authentication is done via API keys. An API Key can either be created by an organization administrator, in which case it will not be connected to any specific user, or via Personal API Keys to authenticate as a user.

Creating an API Key with a Specific Role

  • Once you've created your organization, you can set up and manage API Keys.

  • Navigate to the Organization Settings page and click the API Keys tab.

  • Click Add API Key and enter a name for your key in the Name field. This name is for reference purposes only and isn't used directly in authentication.

    ❗️Save Your API Key ID and secret The secret will not be available after you close this window.

Creating a Personal API Key

  • Click on your avatar (located on the top right of the screen)

  • Click on Personal Settings

  • Select the API Keys tab

  • Click Add API Key, and enter a name for your key in the Name field. This name is for reference purposes and isn't used directly in authentication.

    ❗️Save your API Key ID & secret The secret will not be available after you close this window.

Using an API Key to Authenticate

Authentication of the env0 API is done using the Basic Authentication method. Each request made should include the API Key ID as the username, and the API Key secret as the password. For example, when using curl, we can include these parameters via flag --user {API Key ID}:{API Key Secret}.

API Key Permissions

When creating an API key through the organization settings, you will need to choose if you’d like to grant it Organization Admin or User permissions. In case of the latter, you can assign fine-grained permissions per project. Personal API Keys can be created through the user’s profile page and will have the same permissions as the user has.

Rate Limits

env0 API allows up to 1K requests per 60 seconds, requests are aggregated by IP, HTTP Method and URI. If you exceed this limit, you will receive a 429 status code.

Path Parameters

testRunId
string
required

Response

200 - application/json
deploymentLogId
string
required
environmentId
string
required
organizationId
string
required
status
enum<string>
Available options:
IN_PROGRESS,
WAITING_FOR_USER,
TIMEOUT,
FAILURE,
SUCCESS,
CANCELLED,
INTERNAL_FAILURE,
ABORTING,
ABORTED,
QUEUED,
SKIPPED,
NEVER_DEPLOYED,
IN_PROGRESS,
WAITING_FOR_USER,
TIMEOUT,
FAILURE,
SUCCESS,
CANCELLED,
INTERNAL_FAILURE,
ABORTING,
ABORTED,
QUEUED,
SKIPPED,
NEVER_DEPLOYED,
IN_PROGRESS,
WAITING_FOR_USER,
TIMEOUT,
FAILURE,
SUCCESS,
CANCELLED,
INTERNAL_FAILURE,
ABORTING,
ABORTED,
QUEUED,
SKIPPED,
NEVER_DEPLOYED
blueprintRevision
string
prNumber
string
startedBy
string
startedByUser
object
createdAt
string<date-time>
queuedAt
string<date-time>
startedAt
string<date-time>
finishedAt
string<date-time>
error
object
customEnv0EnvironmentVariables
object
gitAvatarUrl
string
gitUser
string
blueprintRepository
string
id
string
triggerName
Available options:
user,
terraform-cli,
workflow,
user,
terraform-cli,
workflow,
user,
terraform-cli,
workflow
testSummary
object
testFilesResults
object
moduleId
string
I