Skip to content

Retrieve a sequence test

client.sequence.retrieveTest(stringtestID, SequenceRetrieveTestParams { id } params, RequestOptionsoptions?): SequenceRetrieveTestResponse { id, contactId, status, 2 more }
GET/v1/sequences/{id}/tests/{testId}

Retrieves the result of a test started with Start a sequence test: its status, and for every step of the tested version whether it composed a message, was skipped or failed. Poll it until status is COMPLETED or FAILED.

An email step’s message is its subject and a markdown body, and a LinkedIn step’s message is its text. A step that failed carries the reason under error; a template step whose variable could not be filled for the contact fails this way, naming the fields. Steps that have not run are PENDING, including a step a finished test never reached; a step that produced nothing is SKIPPED. A test never waits, so a wait is always SKIPPED; a send step is SKIPPED when it has nothing to send, such as a LinkedIn invite another step already sent. A test never sends anything.

Returns 404 for a test that does not exist, belongs to another sequence, or is a live enrollment: use Retrieve a sequence enrollment for those.

Required scope: sequences:read

Rate limit category: Read

ParametersExpand Collapse
testID: string

The id returned when the test was started.

params: SequenceRetrieveTestParams { id }
id: string

Unique identifier of the sequence.

ReturnsExpand Collapse
SequenceRetrieveTestResponse { id, contactId, status, 2 more }
id: string

ID of the test, an enrollment ID.

contactId: string

ID of the contact tested.

status: "RUNNING" | "COMPLETED" | "FAILED"

RUNNING until every step has finished, then COMPLETED, or FAILED when the test ended on a failure.

One of the following:
"RUNNING"
"COMPLETED"
"FAILED"
steps: Array<Step>

Every step of the tested version that the Sequences API lists, in run order. Call steps are not part of the API yet, so a test reports nothing for them.

error: Error | null

Why the step failed; null unless outcome is FAILED.

code: "CONFIGURATION_ERROR" | "SYSTEM_ERROR"

CONFIGURATION_ERROR when the sequence or the contact needs a change, SYSTEM_ERROR when Lightfield failed.

One of the following:
"CONFIGURATION_ERROR"
"SYSTEM_ERROR"
message: string

What went wrong, in plain words.

message: EmailMessage { body, subject } | LinkedInMessage { body } | null

The composed message; null when the step has not composed one.

One of the following:
EmailMessage { body, subject }
body: string

Body as markdown, the same form a template step reads back in.

subject: string

Subject line, as composed.

LinkedInMessage { body }
body: string

Message text, as composed.

mode: "AGENT" | "TEMPLATE" | null

How a send step’s content is composed; null for a wait step.

One of the following:
"AGENT"
"TEMPLATE"
name: string | null

Name of the step, as in definition.steps; null for a wait step.

outcome: "PENDING" | "COMPOSED" | "SKIPPED" | "FAILED"

PENDING while the step has not run, including a step a finished test never reached, COMPOSED when it produced a message, SKIPPED when it produced nothing: a test never waits, so a wait is always SKIPPED, and a send step is SKIPPED when it has nothing to send, such as a LinkedIn invite another step already sent. FAILED when it failed: see error.

One of the following:
"PENDING"
"COMPOSED"
"SKIPPED"
"FAILED"
stepId: string

ID of the step, as in the sequence’s definition.steps.

type: "EMAIL" | "LINKEDIN_MESSAGE" | "LINKEDIN_INVITE" | 2 more

Step type.

One of the following:
"EMAIL"
"LINKEDIN_MESSAGE"
"LINKEDIN_INVITE"
"WAIT"
"WAIT_FOR_CONNECTION"
target: "DRAFT" | "PUBLISHED"

Which version was tested.

One of the following:
"DRAFT"
"PUBLISHED"

Retrieve a sequence test

import Lightfield from 'lightfield';

const client = new Lightfield({
  apiKey: 'My API Key',
});

const sequenceRetrieveTestResponse = await client.sequence.retrieveTest('testId', { id: 'id' });

console.log(sequenceRetrieveTestResponse.id);
{
  "id": "id",
  "contactId": "contactId",
  "status": "RUNNING",
  "steps": [
    {
      "error": {
        "code": "CONFIGURATION_ERROR",
        "message": "message"
      },
      "message": {
        "body": "body",
        "subject": "subject"
      },
      "mode": "AGENT",
      "name": "name",
      "outcome": "PENDING",
      "stepId": "stepId",
      "type": "EMAIL"
    }
  ],
  "target": "DRAFT"
}
Returns Examples
{
  "id": "id",
  "contactId": "contactId",
  "status": "RUNNING",
  "steps": [
    {
      "error": {
        "code": "CONFIGURATION_ERROR",
        "message": "message"
      },
      "message": {
        "body": "body",
        "subject": "subject"
      },
      "mode": "AGENT",
      "name": "name",
      "outcome": "PENDING",
      "stepId": "stepId",
      "type": "EMAIL"
    }
  ],
  "target": "DRAFT"
}