Skip to content

Retrieve a sequence draft

client.Sequence.GetDraft(ctx, id) (*SequenceRetrieveDraftResponse, error)
GET/v1/sequences/{id}/draft

Retrieves the sequence’s open draft, the same one editors see in Lightfield. Returns 404 draft_not_found when no draft is open.

Required scope: sequences:read

Rate limit category: Read

ParametersExpand Collapse
id string

Unique identifier of the sequence.

ReturnsExpand Collapse
type SequenceRetrieveDraftResponse struct{…}
Channels []string

Channels the draft’s steps send on.

One of the following:
const SequenceRetrieveDraftResponseChannelEmail SequenceRetrieveDraftResponseChannel = "EMAIL"
const SequenceRetrieveDraftResponseChannelLinkedin SequenceRetrieveDraftResponseChannel = "LINKEDIN"
Definition SequenceRetrieveDraftResponseDefinition

The draft configuration, in the same shape as a published definition.

Description string

What this version of the sequence is for.

Messaging SequenceRetrieveDraftResponseDefinitionMessaging

Messaging inputs that frame every step.

CallToAction string

What the recipient is asked to do.

Persona string

Who the sequence targets.

Trigger string

Why the outreach is timely.

ValueProp string

The value proposition.

Pacing SequenceRetrieveDraftResponseDefinitionPacing

How the whole sequence paces each step type it sends, keyed by sequence step type.

Email SequenceRetrieveDraftResponseDefinitionPacingEmail

Email steps.

DailyLimit int64

Most sends of this step type across the whole sequence in any rolling 24 hours, or null when the sequence sets no daily cap. Workspace and sender limits still apply.

minimum-9007199254740991
maximum9007199254740991
LinkedinInvite SequenceRetrieveDraftResponseDefinitionPacingLinkedinInvite

LinkedIn connection requests.

DailyLimit int64

Most sends of this step type across the whole sequence in any rolling 24 hours, or null when the sequence sets no daily cap. Workspace and sender limits still apply.

minimum-9007199254740991
maximum9007199254740991
LinkedinMessage SequenceRetrieveDraftResponseDefinitionPacingLinkedinMessage

LinkedIn messages.

DailyLimit int64

Most sends of this step type across the whole sequence in any rolling 24 hours, or null when the sequence sets no daily cap. Workspace and sender limits still apply.

minimum-9007199254740991
maximum9007199254740991
Priority string

Send priority relative to other sequences.

One of the following:
const SequenceRetrieveDraftResponseDefinitionPriorityHigh SequenceRetrieveDraftResponseDefinitionPriority = "HIGH"
const SequenceRetrieveDraftResponseDefinitionPriorityNormal SequenceRetrieveDraftResponseDefinitionPriority = "NORMAL"
SendWindow SequenceRetrieveDraftResponseDefinitionSendWindow

When the sequence may send.

DaysOfWeek []int64

Days sends may go out, 0 = Sunday.

EndHour int64

Local hour sends stop, exclusive (1–24).

minimum-9007199254740991
maximum9007199254740991
StartHour int64

First local hour sends may go out (0–23).

minimum-9007199254740991
maximum9007199254740991
Timezone string

IANA timezone of the window.

Steps []SequenceRetrieveDraftResponseDefinitionStepUnion

Email, LinkedIn and wait steps in execution order.

One of the following:
type SequenceRetrieveDraftResponseDefinitionStepObject struct{…}
ID string

Step identifier, referenced by enrollment currentStepId and message sequenceStepId.

DeliveryMode string

AUTO sends without manual approval, subject to the send window and limits; FOR_REVIEW requires a person to approve the draft before sending.

One of the following:
const SequenceRetrieveDraftResponseDefinitionStepObjectDeliveryModeAuto SequenceRetrieveDraftResponseDefinitionStepObjectDeliveryMode = "AUTO"
const SequenceRetrieveDraftResponseDefinitionStepObjectDeliveryModeForReview SequenceRetrieveDraftResponseDefinitionStepObjectDeliveryMode = "FOR_REVIEW"
Mode string

How each message is written: AGENT composes it from prompt; TEMPLATE sends template to every contact, with its variables filled in.

Name string

Display name of the step.

Prompt string

Instructions the agent follows when composing this message.

Type string

Step type.

One of the following:
const SequenceRetrieveDraftResponseDefinitionStepObjectTypeEmail SequenceRetrieveDraftResponseDefinitionStepObjectType = "EMAIL"
const SequenceRetrieveDraftResponseDefinitionStepObjectTypeLinkedinMessage SequenceRetrieveDraftResponseDefinitionStepObjectType = "LINKEDIN_MESSAGE"
type SequenceRetrieveDraftResponseDefinitionStepObject2 struct{…}
ID string

Step identifier, referenced by enrollment currentStepId and message sequenceStepId.

DeliveryMode string

AUTO sends without manual approval, subject to the send window and limits; FOR_REVIEW requires a person to approve the draft before sending.

One of the following:
const SequenceRetrieveDraftResponseDefinitionStepObject2DeliveryModeAuto SequenceRetrieveDraftResponseDefinitionStepObject2DeliveryMode = "AUTO"
const SequenceRetrieveDraftResponseDefinitionStepObject2DeliveryModeForReview SequenceRetrieveDraftResponseDefinitionStepObject2DeliveryMode = "FOR_REVIEW"
IncludeNote bool

Whether the connection request carries a note. A step authored before this setting existed reads as true.

Mode string

How each message is written: AGENT composes it from prompt; TEMPLATE sends template to every contact, with its variables filled in.

Name string

Display name of the step.

Prompt string

Instructions the agent follows when composing this message.

Type string

Step type.

type SequenceRetrieveDraftResponseDefinitionStepObject3 struct{…}
ID string

Step identifier, referenced by enrollment currentStepId and message sequenceStepId.

DeliveryMode string

AUTO sends without manual approval, subject to the send window and limits; FOR_REVIEW requires a person to approve the draft before sending.

One of the following:
const SequenceRetrieveDraftResponseDefinitionStepObject3DeliveryModeAuto SequenceRetrieveDraftResponseDefinitionStepObject3DeliveryMode = "AUTO"
const SequenceRetrieveDraftResponseDefinitionStepObject3DeliveryModeForReview SequenceRetrieveDraftResponseDefinitionStepObject3DeliveryMode = "FOR_REVIEW"
Mode string

How each message is written: AGENT composes it from prompt; TEMPLATE sends template to every contact, with its variables filled in.

Name string

Display name of the step.

Template SequenceRetrieveDraftResponseDefinitionStepObject3Template

The email every contact receives.

Body string

Email body as Markdown, without the sign-off or signature, which are added when the message is written. Each {{ }} is a variable filled in per contact, with a fallback for a contact missing the value; a field variable names the field by the ad_ ID the field-definitions endpoints list.

Subject string

Plain-text subject line. Each {{ }} is a variable filled in per contact, with a fallback for a contact missing the value; a field variable names the field by the ad_ ID the field-definitions endpoints list.

Type string

Step type.

type SequenceRetrieveDraftResponseDefinitionStepObject4 struct{…}
ID string

Step identifier, referenced by enrollment currentStepId and message sequenceStepId.

DeliveryMode string

AUTO sends without manual approval, subject to the send window and limits; FOR_REVIEW requires a person to approve the draft before sending.

One of the following:
const SequenceRetrieveDraftResponseDefinitionStepObject4DeliveryModeAuto SequenceRetrieveDraftResponseDefinitionStepObject4DeliveryMode = "AUTO"
const SequenceRetrieveDraftResponseDefinitionStepObject4DeliveryModeForReview SequenceRetrieveDraftResponseDefinitionStepObject4DeliveryMode = "FOR_REVIEW"
Mode string

How each message is written: AGENT composes it from prompt; TEMPLATE sends template to every contact, with its variables filled in.

Name string

Display name of the step.

Template SequenceRetrieveDraftResponseDefinitionStepObject4Template

The message every contact receives; for an invite, its connection note, sent only with includeNote.

Body string

Plain-text message. Each {{ }} is a variable filled in per contact, with a fallback for a contact missing the value; a field variable names the field by the ad_ ID the field-definitions endpoints list.

Type string

Step type.

type SequenceRetrieveDraftResponseDefinitionStepObject5 struct{…}
ID string

Step identifier, referenced by enrollment currentStepId and message sequenceStepId.

DeliveryMode string

AUTO sends without manual approval, subject to the send window and limits; FOR_REVIEW requires a person to approve the draft before sending.

One of the following:
const SequenceRetrieveDraftResponseDefinitionStepObject5DeliveryModeAuto SequenceRetrieveDraftResponseDefinitionStepObject5DeliveryMode = "AUTO"
const SequenceRetrieveDraftResponseDefinitionStepObject5DeliveryModeForReview SequenceRetrieveDraftResponseDefinitionStepObject5DeliveryMode = "FOR_REVIEW"
IncludeNote bool

Whether the connection request carries a note. A step authored before this setting existed reads as true.

Mode string

How each message is written: AGENT composes it from prompt; TEMPLATE sends template to every contact, with its variables filled in.

Name string

Display name of the step.

Template SequenceRetrieveDraftResponseDefinitionStepObject5Template

The message every contact receives; for an invite, its connection note, sent only with includeNote.

Body string

Plain-text message. Each {{ }} is a variable filled in per contact, with a fallback for a contact missing the value; a field variable names the field by the ad_ ID the field-definitions endpoints list.

Type string

Step type.

type SequenceRetrieveDraftResponseDefinitionStepObject6 struct{…}
ID string

Step identifier.

Duration int64

Length of the wait.

minimum-9007199254740991
maximum9007199254740991
Type string

WAIT pauses for a fixed time; WAIT_FOR_CONNECTION waits up to that long for a LinkedIn invite to be accepted.

One of the following:
const SequenceRetrieveDraftResponseDefinitionStepObject6TypeWait SequenceRetrieveDraftResponseDefinitionStepObject6Type = "WAIT"
const SequenceRetrieveDraftResponseDefinitionStepObject6TypeWaitForConnection SequenceRetrieveDraftResponseDefinitionStepObject6Type = "WAIT_FOR_CONNECTION"
Unit string

Unit of duration.

One of the following:
const SequenceRetrieveDraftResponseDefinitionStepObject6UnitDay SequenceRetrieveDraftResponseDefinitionStepObject6Unit = "DAY"
const SequenceRetrieveDraftResponseDefinitionStepObject6UnitMinute SequenceRetrieveDraftResponseDefinitionStepObject6Unit = "MINUTE"
Name string

Name the sequence takes when the draft is published.

PublishWarnings []SequenceRetrieveDraftResponsePublishWarning

What publishing this draft would change for contacts already in the sequence; empty when nothing is affected. Before the first publish, the only possible warning is a proposed sender that was archived and would be left off.

Code string

What publishing would change.

One of the following:
const SequenceRetrieveDraftResponsePublishWarningCodeDelayShortened SequenceRetrieveDraftResponsePublishWarningCode = "delay_shortened"
const SequenceRetrieveDraftResponsePublishWarningCodeDelayLengthened SequenceRetrieveDraftResponsePublishWarningCode = "delay_lengthened"
const SequenceRetrieveDraftResponsePublishWarningCodeConnectionWaitShortened SequenceRetrieveDraftResponsePublishWarningCode = "connection_wait_shortened"
const SequenceRetrieveDraftResponsePublishWarningCodeConnectionWaitLengthened SequenceRetrieveDraftResponsePublishWarningCode = "connection_wait_lengthened"
const SequenceRetrieveDraftResponsePublishWarningCodeSendScheduleChanged SequenceRetrieveDraftResponsePublishWarningCode = "send_schedule_changed"
const SequenceRetrieveDraftResponsePublishWarningCodeSendConfigurationChanged SequenceRetrieveDraftResponsePublishWarningCode = "send_configuration_changed"
const SequenceRetrieveDraftResponsePublishWarningCodeSendPriorityChanged SequenceRetrieveDraftResponsePublishWarningCode = "send_priority_changed"
const SequenceRetrieveDraftResponsePublishWarningCodeSendersChanged SequenceRetrieveDraftResponsePublishWarningCode = "senders_changed"
const SequenceRetrieveDraftResponsePublishWarningCodeEmailSenderPoolEmptied SequenceRetrieveDraftResponsePublishWarningCode = "email_sender_pool_emptied"
const SequenceRetrieveDraftResponsePublishWarningCodeLinkedinAccountPoolEmptied SequenceRetrieveDraftResponsePublishWarningCode = "linkedin_account_pool_emptied"
const SequenceRetrieveDraftResponsePublishWarningCodeAssignedSenderRemoved SequenceRetrieveDraftResponsePublishWarningCode = "assigned_sender_removed"
const SequenceRetrieveDraftResponsePublishWarningCodeDeliveryBecameAutomatic SequenceRetrieveDraftResponsePublishWarningCode = "delivery_became_automatic"
const SequenceRetrieveDraftResponsePublishWarningCodeInviteNoteEnabled SequenceRetrieveDraftResponsePublishWarningCode = "invite_note_enabled"
const SequenceRetrieveDraftResponsePublishWarningCodeInviteNoteDisabled SequenceRetrieveDraftResponsePublishWarningCode = "invite_note_disabled"
const SequenceRetrieveDraftResponsePublishWarningCodeStepInserted SequenceRetrieveDraftResponsePublishWarningCode = "step_inserted"
const SequenceRetrieveDraftResponsePublishWarningCodeAutomaticSendStepInserted SequenceRetrieveDraftResponsePublishWarningCode = "automatic_send_step_inserted"
const SequenceRetrieveDraftResponsePublishWarningCodeStepRemoved SequenceRetrieveDraftResponsePublishWarningCode = "step_removed"
const SequenceRetrieveDraftResponsePublishWarningCodeStepTypeChanged SequenceRetrieveDraftResponsePublishWarningCode = "step_type_changed"
const SequenceRetrieveDraftResponsePublishWarningCodeStepOrderChanged SequenceRetrieveDraftResponsePublishWarningCode = "step_order_changed"
const SequenceRetrieveDraftResponsePublishWarningCodeFullIdentityRewrite SequenceRetrieveDraftResponsePublishWarningCode = "full_identity_rewrite"
const SequenceRetrieveDraftResponsePublishWarningCodeLowIdentityOverlap SequenceRetrieveDraftResponsePublishWarningCode = "low_identity_overlap"
Message string

What would change, in plain language.

Severity string

destructive when contacts already in the sequence may skip, repeat or receive a step they would not have; warning otherwise.

One of the following:
const SequenceRetrieveDraftResponsePublishWarningSeverityWarning SequenceRetrieveDraftResponsePublishWarningSeverity = "warning"
const SequenceRetrieveDraftResponsePublishWarningSeverityDestructive SequenceRetrieveDraftResponsePublishWarningSeverity = "destructive"
StepIDs []string

The steps involved; empty for a sequence-wide change.

Reviewers []SequenceRetrieveDraftResponseReviewer

Extra members who may approve this sequence’s FOR_REVIEW messages before they send. The sending member and the sequence’s creator always review, whether or not they are listed.

ID string

ID of the member.

minLength1
ObjectType string

Always member.

Senders []SequenceRetrieveDraftResponseSender

The senders this draft will publish; new contacts rotate across them. Until a save changes it, this is the sequence’s live list. An archived sender stays listed but never sends; any change to the list drops it.

ID string

ID of the sender.

minLength1
ObjectType string

Always sender.

SequenceID string

The sequence this draft belongs to.

UpdatedAt string

When the draft last changed.

Version string

Opaque token for the current state of the draft. Send it as expectedVersion on the next save, publish or discard; it changes whenever anyone edits the draft.

Retrieve a sequence draft

package main

import (
  "context"
  "fmt"

  "github.com/Lightfld/lightfield-go"
  "github.com/Lightfld/lightfield-go/option"
)

func main() {
  client := githubcomlightfldlightfieldgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  sequenceRetrieveDraftResponse, err := client.Sequence.GetDraft(context.TODO(), "id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", sequenceRetrieveDraftResponse.Channels)
}
{
  "channels": [
    "EMAIL"
  ],
  "definition": {
    "description": "description",
    "messaging": {
      "callToAction": "callToAction",
      "persona": "persona",
      "trigger": "trigger",
      "valueProp": "valueProp"
    },
    "pacing": {
      "EMAIL": {
        "dailyLimit": -9007199254740991
      },
      "LINKEDIN_INVITE": {
        "dailyLimit": -9007199254740991
      },
      "LINKEDIN_MESSAGE": {
        "dailyLimit": -9007199254740991
      }
    },
    "priority": "HIGH",
    "sendWindow": {
      "daysOfWeek": [
        -9007199254740991
      ],
      "endHour": -9007199254740991,
      "startHour": -9007199254740991,
      "timezone": "timezone"
    },
    "steps": [
      {
        "id": "id",
        "deliveryMode": "AUTO",
        "mode": "AGENT",
        "name": "name",
        "prompt": "prompt",
        "type": "EMAIL"
      }
    ]
  },
  "name": "name",
  "publishWarnings": [
    {
      "code": "delay_shortened",
      "message": "message",
      "severity": "warning",
      "stepIds": [
        "string"
      ]
    }
  ],
  "reviewers": [
    {
      "id": "x",
      "objectType": "member"
    }
  ],
  "senders": [
    {
      "id": "x",
      "objectType": "sender"
    }
  ],
  "sequenceId": "sequenceId",
  "updatedAt": "updatedAt",
  "version": "version"
}
Returns Examples
{
  "channels": [
    "EMAIL"
  ],
  "definition": {
    "description": "description",
    "messaging": {
      "callToAction": "callToAction",
      "persona": "persona",
      "trigger": "trigger",
      "valueProp": "valueProp"
    },
    "pacing": {
      "EMAIL": {
        "dailyLimit": -9007199254740991
      },
      "LINKEDIN_INVITE": {
        "dailyLimit": -9007199254740991
      },
      "LINKEDIN_MESSAGE": {
        "dailyLimit": -9007199254740991
      }
    },
    "priority": "HIGH",
    "sendWindow": {
      "daysOfWeek": [
        -9007199254740991
      ],
      "endHour": -9007199254740991,
      "startHour": -9007199254740991,
      "timezone": "timezone"
    },
    "steps": [
      {
        "id": "id",
        "deliveryMode": "AUTO",
        "mode": "AGENT",
        "name": "name",
        "prompt": "prompt",
        "type": "EMAIL"
      }
    ]
  },
  "name": "name",
  "publishWarnings": [
    {
      "code": "delay_shortened",
      "message": "message",
      "severity": "warning",
      "stepIds": [
        "string"
      ]
    }
  ],
  "reviewers": [
    {
      "id": "x",
      "objectType": "member"
    }
  ],
  "senders": [
    {
      "id": "x",
      "objectType": "sender"
    }
  ],
  "sequenceId": "sequenceId",
  "updatedAt": "updatedAt",
  "version": "version"
}