Skip to content

Retrieve a sequence test

sequence.retrieve_test(strtest_id, SequenceRetrieveTestParams**kwargs) -> SequenceRetrieveTestResponse
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
id: str

Unique identifier of the sequence.

test_id: str

The id returned when the test was started.

ReturnsExpand Collapse
class SequenceRetrieveTestResponse: …
id: str

ID of the test, an enrollment ID.

contact_id: str

ID of the contact tested.

status: Literal["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: List[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: Optional[StepError]

Why the step failed; null unless outcome is FAILED.

code: Literal["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: str

What went wrong, in plain words.

message: Optional[StepMessage]

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

One of the following:
class StepMessageEmailMessage: …
body: str

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

subject: str

Subject line, as composed.

class StepMessageLinkedInMessage: …
body: str

Message text, as composed.

mode: Optional[Literal["AGENT", "TEMPLATE"]]

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

One of the following:
"AGENT"
"TEMPLATE"
name: Optional[str]

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

outcome: Literal["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"
step_id: str

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

type: Literal["EMAIL", "LINKEDIN_MESSAGE", "LINKEDIN_INVITE", 2 more]

Step type.

One of the following:
"EMAIL"
"LINKEDIN_MESSAGE"
"LINKEDIN_INVITE"
"WAIT"
"WAIT_FOR_CONNECTION"
target: Literal["DRAFT", "PUBLISHED"]

Which version was tested.

One of the following:
"DRAFT"
"PUBLISHED"

Retrieve a sequence test

from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_retrieve_test_response = client.sequence.retrieve_test(
    test_id="testId",
    id="id",
)
print(sequence_retrieve_test_response.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"
}