# Sequence

## List sequences

`sequence.list(SequenceListParams**kwargs)  -> SequenceListResponse`

**get** `/v1/sequences`

Returns a paginated list of sequences, including ones that have never been published. Results are sorted by when the sequence was created (`createdAt`), newest first. Use `offset` and `limit` to paginate through results, and bracketed filters to narrow the list. See <u>[List endpoints](/using-the-api/list-endpoints/)</u> for more information about pagination.

Supported filters: `status[equal]` (DRAFT, ACTIVE, DEACTIVATED), `channels[contains]` (EMAIL, LINKEDIN), and `createdAt`, `firstActivatedAt` or `lastActivatedAt` with `[greaterThanOrEqual]` or `[lessThanOrEqual]` (ISO 8601 timestamps with a timezone). Filters are combined with AND.

**[Required scope](/using-the-api/scopes/):** `sequences:read`

**[Rate limit category](/using-the-api/rate-limits/):** Search

### Parameters

- `limit: Optional[int]`

  Maximum number of records to return. Defaults to 25, maximum 25.

- `offset: Optional[int]`

  Number of records to skip for pagination. Defaults to 0.

### Returns

- `class SequenceListResponse: …`

  - `data: List[Data]`

    - `id: str`

      Unique identifier of the sequence.

    - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

      Channels the published steps send on; empty before the first publish.

      - `"EMAIL"`

      - `"LINKEDIN"`

    - `created_at: str`

      ISO 8601 creation timestamp.

    - `definition: Optional[DataDefinition]`

      Published configuration, or null before the first publish.

      - `description: str`

        What this version of the sequence is for.

      - `messaging: DataDefinitionMessaging`

        Messaging inputs that frame every step.

        - `call_to_action: Optional[str]`

          What the recipient is asked to do.

        - `persona: Optional[str]`

          Who the sequence targets.

        - `trigger: Optional[str]`

          Why the outreach is timely.

        - `value_prop: Optional[str]`

          The value proposition.

      - `pacing: DataDefinitionPacing`

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

        - `email: DataDefinitionPacingEmail`

          Email steps.

          - `daily_limit: Optional[int]`

            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.

        - `linkedin_invite: DataDefinitionPacingLinkedinInvite`

          LinkedIn connection requests.

          - `daily_limit: Optional[int]`

            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.

        - `linkedin_message: DataDefinitionPacingLinkedinMessage`

          LinkedIn messages.

          - `daily_limit: Optional[int]`

            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.

      - `priority: Literal["HIGH", "NORMAL"]`

        Send priority relative to other sequences.

        - `"HIGH"`

        - `"NORMAL"`

      - `send_window: DataDefinitionSendWindow`

        When the sequence may send.

        - `days_of_week: List[int]`

          Days sends may go out, 0 = Sunday.

        - `end_hour: int`

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

        - `start_hour: int`

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

        - `timezone: str`

          IANA timezone of the window.

      - `steps: List[DataDefinitionStep]`

        Email, LinkedIn and wait steps in execution order.

        - `class DataDefinitionStepUnionMember0: …`

          - `id: str`

            Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

          - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

            - `"AUTO"`

            - `"FOR_REVIEW"`

          - `mode: Literal["AGENT"]`

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

            - `"AGENT"`

          - `name: str`

            Display name of the step.

          - `prompt: str`

            Instructions the agent follows when composing this message.

          - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

            Step type.

            - `"EMAIL"`

            - `"LINKEDIN_MESSAGE"`

        - `class DataDefinitionStepUnionMember1: …`

          - `id: str`

            Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

          - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

            - `"AUTO"`

            - `"FOR_REVIEW"`

          - `include_note: bool`

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

          - `mode: Literal["AGENT"]`

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

            - `"AGENT"`

          - `name: str`

            Display name of the step.

          - `prompt: str`

            Instructions the agent follows when composing this message.

          - `type: Literal["LINKEDIN_INVITE"]`

            Step type.

            - `"LINKEDIN_INVITE"`

        - `class DataDefinitionStepUnionMember2: …`

          - `id: str`

            Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

          - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

            - `"AUTO"`

            - `"FOR_REVIEW"`

          - `mode: Literal["TEMPLATE"]`

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

            - `"TEMPLATE"`

          - `name: str`

            Display name of the step.

          - `template: DataDefinitionStepUnionMember2Template`

            The email every contact receives.

            - `body: str`

              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: str`

              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: Literal["EMAIL"]`

            Step type.

            - `"EMAIL"`

        - `class DataDefinitionStepUnionMember3: …`

          - `id: str`

            Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

          - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

            - `"AUTO"`

            - `"FOR_REVIEW"`

          - `mode: Literal["TEMPLATE"]`

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

            - `"TEMPLATE"`

          - `name: str`

            Display name of the step.

          - `template: DataDefinitionStepUnionMember3Template`

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

            - `body: str`

              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: Literal["LINKEDIN_MESSAGE"]`

            Step type.

            - `"LINKEDIN_MESSAGE"`

        - `class DataDefinitionStepUnionMember4: …`

          - `id: str`

            Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

          - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

            - `"AUTO"`

            - `"FOR_REVIEW"`

          - `include_note: bool`

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

          - `mode: Literal["TEMPLATE"]`

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

            - `"TEMPLATE"`

          - `name: str`

            Display name of the step.

          - `template: DataDefinitionStepUnionMember4Template`

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

            - `body: str`

              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: Literal["LINKEDIN_INVITE"]`

            Step type.

            - `"LINKEDIN_INVITE"`

        - `class DataDefinitionStepUnionMember5: …`

          - `id: str`

            Step identifier.

          - `duration: int`

            Length of the wait.

          - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

            - `"WAIT"`

            - `"WAIT_FOR_CONNECTION"`

          - `unit: Literal["DAY", "MINUTE"]`

            Unit of `duration`.

            - `"DAY"`

            - `"MINUTE"`

    - `first_activated_at: Optional[str]`

      When the sequence was first activated.

    - `last_activated_at: Optional[str]`

      When the sequence was most recently activated.

    - `name: str`

      Name of the sequence.

    - `object_type: Literal["sequence"]`

      Always `sequence`.

      - `"sequence"`

    - `reviewers: List[DataReviewer]`

      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: str`

        ID of the member.

      - `object_type: Literal["member"]`

        Always `member`.

        - `"member"`

    - `senders: List[DataSender]`

      The senders this sequence sends from; new contacts rotate across them. An archived sender stays listed but never sends; any change to the list drops it.

      - `id: str`

        ID of the sender.

      - `object_type: Literal["sender"]`

        Always `sender`.

        - `"sender"`

    - `status: Literal["DRAFT", "ACTIVE", "DEACTIVATED"]`

      `DRAFT` has not been published; `ACTIVE` is enabled for sending; `DEACTIVATED` is published but paused.

      - `"DRAFT"`

      - `"ACTIVE"`

      - `"DEACTIVATED"`

  - `object: Literal["list"]`

    - `"list"`

  - `total_count: int`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_list_response = client.sequence.list()
print(sequence_list_response.data)
```

#### Response

```json
{
  "data": [
    {
      "id": "id",
      "channels": [
        "EMAIL"
      ],
      "createdAt": "createdAt",
      "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"
          }
        ]
      },
      "firstActivatedAt": "firstActivatedAt",
      "lastActivatedAt": "lastActivatedAt",
      "name": "name",
      "objectType": "sequence",
      "reviewers": [
        {
          "id": "x",
          "objectType": "member"
        }
      ],
      "senders": [
        {
          "id": "x",
          "objectType": "sender"
        }
      ],
      "status": "DRAFT"
    }
  ],
  "object": "list",
  "totalCount": -9007199254740991
}
```

## Retrieve a sequence

`sequence.retrieve(strid)  -> SequenceRetrieveResponse`

**get** `/v1/sequences/{id}`

Retrieves a single sequence by its ID. Edits that have not been published are not included; those can be read with [Retrieve a sequence draft](/api/resources/sequence/methods/retrieveDraft).

**[Required scope](/using-the-api/scopes/):** `sequences:read`

**[Rate limit category](/using-the-api/rate-limits/):** Read

### Parameters

- `id: str`

  Unique identifier of the sequence to retrieve.

### Returns

- `class SequenceRetrieveResponse: …`

  - `id: str`

    Unique identifier of the sequence.

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the published steps send on; empty before the first publish.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `created_at: str`

    ISO 8601 creation timestamp.

  - `definition: Optional[Definition]`

    Published configuration, or null before the first publish.

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `first_activated_at: Optional[str]`

    When the sequence was first activated.

  - `last_activated_at: Optional[str]`

    When the sequence was most recently activated.

  - `name: str`

    Name of the sequence.

  - `object_type: Literal["sequence"]`

    Always `sequence`.

    - `"sequence"`

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    The senders this sequence sends from; new contacts rotate across them. An archived sender stays listed but never sends; any change to the list drops it.

    - `id: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `status: Literal["DRAFT", "ACTIVE", "DEACTIVATED"]`

    `DRAFT` has not been published; `ACTIVE` is enabled for sending; `DEACTIVATED` is published but paused.

    - `"DRAFT"`

    - `"ACTIVE"`

    - `"DEACTIVATED"`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_retrieve_response = client.sequence.retrieve(
    "id",
)
print(sequence_retrieve_response.id)
```

#### Response

```json
{
  "id": "id",
  "channels": [
    "EMAIL"
  ],
  "createdAt": "createdAt",
  "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"
      }
    ]
  },
  "firstActivatedAt": "firstActivatedAt",
  "lastActivatedAt": "lastActivatedAt",
  "name": "name",
  "objectType": "sequence",
  "reviewers": [
    {
      "id": "x",
      "objectType": "member"
    }
  ],
  "senders": [
    {
      "id": "x",
      "objectType": "sender"
    }
  ],
  "status": "DRAFT"
}
```

## Retrieve sequence performance

`sequence.retrieve_performance(strid)  -> SequenceRetrievePerformanceResponse`

**get** `/v1/sequences/{id}/performance`

Retrieves a sequence’s lifetime engagement, totalled by step type and broken down per step, with the live enrollments currently on each step. Test runs are not counted. A sequence that has never been published reports zero counts and no steps.

**[Required scope](/using-the-api/scopes/):** `sequences:read`

**[Rate limit category](/using-the-api/rate-limits/):** Read

### Parameters

- `id: str`

  Unique identifier of the sequence.

### Returns

- `class SequenceRetrievePerformanceResponse: …`

  - `by_step_type: ByStepType`

    Lifetime totals for each step type, across all of its steps.

    - `email: ByStepTypeEmail`

      Email steps.

      - `bounced: int`

        Sent emails that bounced.

      - `bounce_rate: Optional[float]`

        Bounced divided by sent; null if none sent.

      - `current_enrollments: int`

        Enrollments currently on steps of this type, paused ones included.

      - `delivered: int`

        Sent minus bounced, never below zero.

      - `opened: int`

        Sent emails that were opened.

      - `open_rate: Optional[float]`

        Opened divided by delivered; null if none delivered.

      - `replied: int`

        Sent messages that received a reply.

      - `reply_rate: Optional[float]`

        Replied divided by delivered; null if none delivered.

      - `sent: int`

        Messages sent.

    - `linkedin_invite: ByStepTypeLinkedinInvite`

      LinkedIn connection request steps.

      - `acceptance_rate: Optional[float]`

        Accepted divided by sent; null if none sent.

      - `accepted: int`

        Connection requests that were accepted.

      - `current_enrollments: int`

        Enrollments currently on steps of this type, paused ones included.

      - `replied: int`

        Sent messages that received a reply.

      - `reply_rate: Optional[float]`

        Replied divided by sent; null if none sent.

      - `sent: int`

        Messages sent.

    - `linkedin_message: ByStepTypeLinkedinMessage`

      LinkedIn message steps.

      - `current_enrollments: int`

        Enrollments currently on steps of this type, paused ones included.

      - `read: int`

        Sent messages that were read.

      - `read_rate: Optional[float]`

        Read divided by sent; null if none sent.

      - `replied: int`

        Sent messages that received a reply.

      - `reply_rate: Optional[float]`

        Replied divided by sent; null if none sent.

      - `sent: int`

        Messages sent.

    - `wait: ByStepTypeWait`

      Wait steps.

      - `current_enrollments: int`

        Enrollments currently on steps of this type, paused ones included.

    - `wait_for_connection: ByStepTypeWaitForConnection`

      Wait-for-connection steps.

      - `current_enrollments: int`

        Enrollments currently on steps of this type, paused ones included.

  - `per_step: List[PerStep]`

    Per-step statistics in published sequence order, including steps with no activity. Steps no longer in the published definition are included if they have sent messages.

    - `class PerStepEmailStep: …`

      - `bounced: int`

        Sent emails that bounced.

      - `bounce_rate: Optional[float]`

        Bounced divided by sent; null if none sent.

      - `current_enrollments: int`

        Enrollments currently on this step, paused ones included.

      - `delivered: int`

        Sent minus bounced, never below zero.

      - `opened: int`

        Sent emails that were opened.

      - `open_rate: Optional[float]`

        Opened divided by delivered; null if none delivered.

      - `replied: int`

        Sent messages that received a reply.

      - `reply_rate: Optional[float]`

        Replied divided by delivered; null if none delivered.

      - `sent: int`

        Messages sent.

      - `sequence_step_id: str`

        ID of the step. A step no longer in the published definition keeps its original ID.

      - `sequence_step_type: Literal["EMAIL"]`

        - `"EMAIL"`

    - `class PerStepLinkedInMessageStep: …`

      - `current_enrollments: int`

        Enrollments currently on this step, paused ones included.

      - `read: int`

        Sent messages that were read.

      - `read_rate: Optional[float]`

        Read divided by sent; null if none sent.

      - `replied: int`

        Sent messages that received a reply.

      - `reply_rate: Optional[float]`

        Replied divided by sent; null if none sent.

      - `sent: int`

        Messages sent.

      - `sequence_step_id: str`

        ID of the step. A step no longer in the published definition keeps its original ID.

      - `sequence_step_type: Literal["LINKEDIN_MESSAGE"]`

        - `"LINKEDIN_MESSAGE"`

    - `class PerStepLinkedInInviteStep: …`

      - `acceptance_rate: Optional[float]`

        Accepted divided by sent; null if none sent.

      - `accepted: int`

        Connection requests that were accepted.

      - `current_enrollments: int`

        Enrollments currently on this step, paused ones included.

      - `replied: int`

        Sent messages that received a reply.

      - `reply_rate: Optional[float]`

        Replied divided by sent; null if none sent.

      - `sent: int`

        Messages sent.

      - `sequence_step_id: str`

        ID of the step. A step no longer in the published definition keeps its original ID.

      - `sequence_step_type: Literal["LINKEDIN_INVITE"]`

        - `"LINKEDIN_INVITE"`

    - `class PerStepWaitStep: …`

      - `current_enrollments: int`

        Enrollments currently on this step, paused ones included.

      - `sequence_step_id: str`

        ID of the step. A step no longer in the published definition keeps its original ID.

      - `sequence_step_type: Literal["WAIT"]`

        - `"WAIT"`

    - `class PerStepWaitForConnectionStep: …`

      - `current_enrollments: int`

        Enrollments currently on this step, paused ones included.

      - `sequence_step_id: str`

        ID of the step. A step no longer in the published definition keeps its original ID.

      - `sequence_step_type: Literal["WAIT_FOR_CONNECTION"]`

        - `"WAIT_FOR_CONNECTION"`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_retrieve_performance_response = client.sequence.retrieve_performance(
    "id",
)
print(sequence_retrieve_performance_response.by_step_type)
```

#### Response

```json
{
  "byStepType": {
    "EMAIL": {
      "bounced": -9007199254740991,
      "bounceRate": 0,
      "currentEnrollments": -9007199254740991,
      "delivered": -9007199254740991,
      "opened": -9007199254740991,
      "openRate": 0,
      "replied": -9007199254740991,
      "replyRate": 0,
      "sent": -9007199254740991
    },
    "LINKEDIN_INVITE": {
      "acceptanceRate": 0,
      "accepted": -9007199254740991,
      "currentEnrollments": -9007199254740991,
      "replied": -9007199254740991,
      "replyRate": 0,
      "sent": -9007199254740991
    },
    "LINKEDIN_MESSAGE": {
      "currentEnrollments": -9007199254740991,
      "read": -9007199254740991,
      "readRate": 0,
      "replied": -9007199254740991,
      "replyRate": 0,
      "sent": -9007199254740991
    },
    "WAIT": {
      "currentEnrollments": -9007199254740991
    },
    "WAIT_FOR_CONNECTION": {
      "currentEnrollments": -9007199254740991
    }
  },
  "perStep": [
    {
      "bounced": -9007199254740991,
      "bounceRate": 0,
      "currentEnrollments": -9007199254740991,
      "delivered": -9007199254740991,
      "opened": -9007199254740991,
      "openRate": 0,
      "replied": -9007199254740991,
      "replyRate": 0,
      "sent": -9007199254740991,
      "sequenceStepId": "sequenceStepId",
      "sequenceStepType": "EMAIL"
    }
  ]
}
```

## Retrieve a sequence enrollment

`sequence.retrieve_enrollment(strenrollment_id, SequenceRetrieveEnrollmentParams**kwargs)  -> SequenceRetrieveEnrollmentResponse`

**get** `/v1/sequences/{id}/enrollments/{enrollmentId}`

Retrieves a single enrollment by its ID: the contact’s position in the cadence and its latest activity. Test-run enrollments are not returned.

**[Required scope](/using-the-api/scopes/):** `sequences:read`

**[Rate limit category](/using-the-api/rate-limits/):** Read

### Parameters

- `id: str`

  Unique identifier of the sequence.

- `enrollment_id: str`

  Unique identifier of the enrollment to retrieve.

### Returns

- `class SequenceRetrieveEnrollmentResponse: …`

  - `id: str`

    Unique identifier of the enrollment.

  - `cancelled_at: Optional[str]`

    When the enrollment was cancelled, or null if it was not.

  - `completed_at: Optional[str]`

    When the enrollment completed, or null if it has not.

  - `contact_id: str`

    ID of the enrolled contact.

  - `current_step_id: Optional[str]`

    ID of the step the contact is on, matching `definition.steps`; null when the contact has no current step the API returns.

  - `enrolled_at: str`

    When the contact was enrolled.

  - `enrolled_by: Optional[str]`

    Member ID of whoever enrolled the contact; null when they are no longer a member or the enrollment was automatic.

  - `last_activity_at: Optional[str]`

    When `lastActivityKind` happened; null when there has been no activity.

  - `last_activity_kind: Optional[Literal["SENT", "OPENED", "REPLIED", 4 more]]`

    The latest activity on the enrollment. A reply or bounce that ended the enrollment is reported over a later open.

    - `"SENT"`

    - `"OPENED"`

    - `"REPLIED"`

    - `"BOUNCED"`

    - `"INVITED"`

    - `"CONNECTED"`

    - `"SEEN"`

  - `next_send_at: Optional[str]`

    Estimated time of the next send, from the cadence, send window, pacing and sender; queue order and random gaps can push it later. Null while a message awaits review or is sending, while paused, or when it cannot be estimated.

  - `remaining_sends: Optional[int]`

    Email and LinkedIn steps not yet sent, connection requests included.

  - `replied_at: Optional[str]`

    When the contact first replied, on email or LinkedIn; null if they have not.

  - `status: Optional[Literal["ACTIVE", "AWAITING_REVIEW", "NEEDS_ATTENTION", 5 more]]`

    `ACTIVE` is progressing; `AWAITING_REVIEW` has a message waiting for approval; `NEEDS_ATTENTION` is held by a failed step, a held draft or an unavailable sender; `PAUSED` is stopped because the sequence is deactivated or it was paused in Lightfield. `REPLIED`, `COMPLETED`, `CANCELLED` and `FAILED` are final.

    - `"ACTIVE"`

    - `"AWAITING_REVIEW"`

    - `"NEEDS_ATTENTION"`

    - `"REPLIED"`

    - `"COMPLETED"`

    - `"PAUSED"`

    - `"CANCELLED"`

    - `"FAILED"`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_retrieve_enrollment_response = client.sequence.retrieve_enrollment(
    enrollment_id="enrollmentId",
    id="id",
)
print(sequence_retrieve_enrollment_response.id)
```

#### Response

```json
{
  "id": "id",
  "cancelledAt": "cancelledAt",
  "completedAt": "completedAt",
  "contactId": "contactId",
  "currentStepId": "currentStepId",
  "enrolledAt": "enrolledAt",
  "enrolledBy": "enrolledBy",
  "lastActivityAt": "lastActivityAt",
  "lastActivityKind": "SENT",
  "nextSendAt": "nextSendAt",
  "remainingSends": -9007199254740991,
  "repliedAt": "repliedAt",
  "status": "ACTIVE"
}
```

## List sequence enrollments

`sequence.list_enrollments(strid, SequenceListEnrollmentsParams**kwargs)  -> SequenceListEnrollmentsResponse`

**get** `/v1/sequences/{id}/enrollments`

Returns a paginated list of a sequence’s enrollments, including completed and cancelled ones. Results are sorted by when the contact was enrolled (`enrolledAt`), newest first. Test-run enrollments are not included. Use `offset` and `limit` to paginate through results, and bracketed filters to narrow the list. See <u>[List endpoints](/using-the-api/list-endpoints/)</u> for more information about pagination.

Supported filters: `status[equal]` (ACTIVE, AWAITING_REVIEW, NEEDS_ATTENTION, REPLIED, COMPLETED, PAUSED, CANCELLED, FAILED), `contactId[equal]`, `currentStepId[equal]`, and `enrolledAt`, `lastActivityAt` or `repliedAt` with `[greaterThanOrEqual]` or `[lessThanOrEqual]` (ISO 8601 timestamps with a timezone). Filters are combined with AND.

**[Required scope](/using-the-api/scopes/):** `sequences:read`

**[Rate limit category](/using-the-api/rate-limits/):** Search

### Parameters

- `id: str`

  Unique identifier of the sequence.

- `limit: Optional[int]`

  Maximum number of records to return. Defaults to 25, maximum 25.

- `offset: Optional[int]`

  Number of records to skip for pagination. Defaults to 0.

### Returns

- `class SequenceListEnrollmentsResponse: …`

  - `data: List[Data]`

    - `id: str`

      Unique identifier of the enrollment.

    - `cancelled_at: Optional[str]`

      When the enrollment was cancelled, or null if it was not.

    - `completed_at: Optional[str]`

      When the enrollment completed, or null if it has not.

    - `contact_id: str`

      ID of the enrolled contact.

    - `current_step_id: Optional[str]`

      ID of the step the contact is on, matching `definition.steps`; null when the contact has no current step the API returns.

    - `enrolled_at: str`

      When the contact was enrolled.

    - `enrolled_by: Optional[str]`

      Member ID of whoever enrolled the contact; null when they are no longer a member or the enrollment was automatic.

    - `last_activity_at: Optional[str]`

      When `lastActivityKind` happened; null when there has been no activity.

    - `last_activity_kind: Optional[Literal["SENT", "OPENED", "REPLIED", 4 more]]`

      The latest activity on the enrollment. A reply or bounce that ended the enrollment is reported over a later open.

      - `"SENT"`

      - `"OPENED"`

      - `"REPLIED"`

      - `"BOUNCED"`

      - `"INVITED"`

      - `"CONNECTED"`

      - `"SEEN"`

    - `next_send_at: Optional[str]`

      Estimated time of the next send, from the cadence, send window, pacing and sender; queue order and random gaps can push it later. Null while a message awaits review or is sending, while paused, or when it cannot be estimated.

    - `remaining_sends: Optional[int]`

      Email and LinkedIn steps not yet sent, connection requests included.

    - `replied_at: Optional[str]`

      When the contact first replied, on email or LinkedIn; null if they have not.

    - `status: Optional[Literal["ACTIVE", "AWAITING_REVIEW", "NEEDS_ATTENTION", 5 more]]`

      `ACTIVE` is progressing; `AWAITING_REVIEW` has a message waiting for approval; `NEEDS_ATTENTION` is held by a failed step, a held draft or an unavailable sender; `PAUSED` is stopped because the sequence is deactivated or it was paused in Lightfield. `REPLIED`, `COMPLETED`, `CANCELLED` and `FAILED` are final.

      - `"ACTIVE"`

      - `"AWAITING_REVIEW"`

      - `"NEEDS_ATTENTION"`

      - `"REPLIED"`

      - `"COMPLETED"`

      - `"PAUSED"`

      - `"CANCELLED"`

      - `"FAILED"`

  - `object: Literal["list"]`

    - `"list"`

  - `total_count: int`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_list_enrollments_response = client.sequence.list_enrollments(
    id="id",
)
print(sequence_list_enrollments_response.data)
```

#### Response

```json
{
  "data": [
    {
      "id": "id",
      "cancelledAt": "cancelledAt",
      "completedAt": "completedAt",
      "contactId": "contactId",
      "currentStepId": "currentStepId",
      "enrolledAt": "enrolledAt",
      "enrolledBy": "enrolledBy",
      "lastActivityAt": "lastActivityAt",
      "lastActivityKind": "SENT",
      "nextSendAt": "nextSendAt",
      "remainingSends": -9007199254740991,
      "repliedAt": "repliedAt",
      "status": "ACTIVE"
    }
  ],
  "object": "list",
  "totalCount": -9007199254740991
}
```

## List sequence messages

`sequence.list_messages(strid, SequenceListMessagesParams**kwargs)  -> SequenceListMessagesResponse`

**get** `/v1/sequences/{id}/messages`

Returns a paginated list of a sequence’s messages: every outbound email and LinkedIn message, and each enrollment’s first reply. Results are sorted by `createdAt`, newest first. Superseded outbound attempts are not included, and list items omit content; retrieve a message to read it. Use `offset` and `limit` to paginate through results, and bracketed filters to narrow the list. See <u>[List endpoints](/using-the-api/list-endpoints/)</u> for more information about pagination.

Supported filters: `contactId`, `enrollmentId`, `sequenceStepId`, `sequenceStepType` (EMAIL, LINKEDIN_MESSAGE, LINKEDIN_INVITE), `channel` (EMAIL, LINKEDIN), `direction` (OUTBOUND, INBOUND) and `status` (AWAITING_REVIEW, SCHEDULED, QUEUED, SENT, SKIPPED, FAILED, CANCELLED), with `[equal]` or no operator; and `sentAt`, `openedAt`, `readAt`, `repliedAt`, `bouncedAt`, `acceptedAt` or `receivedAt` with `[greaterThan]`, `[greaterThanOrEqual]`, `[lessThan]` or `[lessThanOrEqual]` (ISO 8601 timestamps with a timezone). Filters are combined with AND; a `status` filter excludes incoming replies.

**[Required scope](/using-the-api/scopes/):** `sequences:read`

**[Rate limit category](/using-the-api/rate-limits/):** Search

### Parameters

- `id: str`

  Unique identifier of the sequence.

- `limit: Optional[int]`

  Maximum number of records to return. Defaults to 25, maximum 25.

- `offset: Optional[int]`

  Number of records to skip for pagination. Defaults to 0.

### Returns

- `class SequenceListMessagesResponse: …`

  - `data: List[Data]`

    - `class DataOutboundMessage: …`

      - `id: str`

        Unique identifier of the message.

      - `accepted_at: Optional[str]`

        When the connection request was accepted; null until then.

      - `bounced_at: Optional[str]`

        When the email bounced; null until then.

      - `channel: Literal["EMAIL", "LINKEDIN"]`

        Channel the message went over.

        - `"EMAIL"`

        - `"LINKEDIN"`

      - `contact_id: str`

        ID of the contact.

      - `created_at: str`

        When the message was created, or when a reply was received. Lists sort by this field, newest first.

      - `direction: Literal["OUTBOUND"]`

        Always `OUTBOUND`.

        - `"OUTBOUND"`

      - `enrollment_id: str`

        ID of the enrollment the message belongs to.

      - `opened_at: Optional[str]`

        When the email was opened; null until then.

      - `read_at: Optional[str]`

        When the LinkedIn message was read; null until then.

      - `reference: Optional[DataOutboundMessageReference]`

        The email or LinkedIn message record behind this sequence message, readable with <u>[Retrieve an email](/api/resources/email/methods/retrieve)</u> or <u>[Retrieve a message](/api/resources/message/methods/retrieve)</u> under their own scopes; null when there is none.

        - `class DataOutboundMessageReferenceEmail: …`

          - `id: str`

            ID of the email.

          - `object_type: Literal["email"]`

            Always `email`.

            - `"email"`

        - `class DataOutboundMessageReferenceMessage: …`

          - `id: str`

            ID of the message.

          - `object_type: Literal["message"]`

            Always `message`.

            - `"message"`

      - `replied_at: Optional[str]`

        When the contact replied to this message; null until then.

      - `sent_at: Optional[str]`

        When the message was sent; null until then.

      - `sequence_step_id: str`

        ID of the step that sent the message or, for a reply, the step it replied to.

      - `sequence_step_type: Literal["EMAIL", "LINKEDIN_MESSAGE", "LINKEDIN_INVITE"]`

        Type of that step.

        - `"EMAIL"`

        - `"LINKEDIN_MESSAGE"`

        - `"LINKEDIN_INVITE"`

      - `status: Literal["AWAITING_REVIEW", "SCHEDULED", "QUEUED", 4 more]`

        `AWAITING_REVIEW` is waiting for approval; `SCHEDULED` is composed and waiting for its send time; `QUEUED` is due and waiting on the sender. `SENT`, `SKIPPED`, `FAILED` and `CANCELLED` are final.

        - `"AWAITING_REVIEW"`

        - `"SCHEDULED"`

        - `"QUEUED"`

        - `"SENT"`

        - `"SKIPPED"`

        - `"FAILED"`

        - `"CANCELLED"`

      - `status_changed_at: str`

        When `status` last changed.

    - `class DataReply: …`

      - `id: str`

        Unique identifier of the message.

      - `channel: Literal["EMAIL", "LINKEDIN"]`

        Channel the message went over.

        - `"EMAIL"`

        - `"LINKEDIN"`

      - `contact_id: str`

        ID of the contact.

      - `created_at: str`

        When the message was created, or when a reply was received. Lists sort by this field, newest first.

      - `direction: Literal["INBOUND"]`

        Always `INBOUND`.

        - `"INBOUND"`

      - `enrollment_id: str`

        ID of the enrollment the message belongs to.

      - `received_at: str`

        When the reply was received.

      - `reference: Optional[DataReplyReference]`

        The email or LinkedIn message record behind this sequence message, readable with <u>[Retrieve an email](/api/resources/email/methods/retrieve)</u> or <u>[Retrieve a message](/api/resources/message/methods/retrieve)</u> under their own scopes; null when there is none.

        - `class DataReplyReferenceEmail: …`

          - `id: str`

            ID of the email.

          - `object_type: Literal["email"]`

            Always `email`.

            - `"email"`

        - `class DataReplyReferenceMessage: …`

          - `id: str`

            ID of the message.

          - `object_type: Literal["message"]`

            Always `message`.

            - `"message"`

      - `sequence_step_id: str`

        ID of the step that sent the message or, for a reply, the step it replied to.

      - `sequence_step_type: Literal["EMAIL", "LINKEDIN_MESSAGE", "LINKEDIN_INVITE"]`

        Type of that step.

        - `"EMAIL"`

        - `"LINKEDIN_MESSAGE"`

        - `"LINKEDIN_INVITE"`

  - `object: Literal["list"]`

    - `"list"`

  - `total_count: int`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_list_messages_response = client.sequence.list_messages(
    id="id",
)
print(sequence_list_messages_response.data)
```

#### Response

```json
{
  "data": [
    {
      "id": "id",
      "acceptedAt": "acceptedAt",
      "bouncedAt": "bouncedAt",
      "channel": "EMAIL",
      "contactId": "contactId",
      "createdAt": "createdAt",
      "direction": "OUTBOUND",
      "enrollmentId": "enrollmentId",
      "openedAt": "openedAt",
      "readAt": "readAt",
      "reference": {
        "id": "id",
        "objectType": "email"
      },
      "repliedAt": "repliedAt",
      "sentAt": "sentAt",
      "sequenceStepId": "sequenceStepId",
      "sequenceStepType": "EMAIL",
      "status": "AWAITING_REVIEW",
      "statusChangedAt": "statusChangedAt"
    }
  ],
  "object": "list",
  "totalCount": -9007199254740991
}
```

## Retrieve a sequence message

`sequence.retrieve_message(strmessage_id, SequenceRetrieveMessageParams**kwargs)  -> SequenceRetrieveMessageResponse`

**get** `/v1/sequences/{id}/messages/{messageId}`

Retrieves a single sequence message by its ID: an outbound email or LinkedIn message, or an enrollment’s first reply, with its plain-text content. Content is returned with `sequences:read` regardless of the email’s privacy; see <u>[Sequence message access](/using-the-api/scopes/#sequence-message-access)</u>.

**[Required scope](/using-the-api/scopes/):** `sequences:read`

**[Rate limit category](/using-the-api/rate-limits/):** Read

### Parameters

- `id: str`

  Unique identifier of the sequence.

- `message_id: str`

  Unique identifier of the message to retrieve.

### Returns

- `SequenceRetrieveMessageResponse`

  - `class OutboundMessage: …`

    - `id: str`

      Unique identifier of the message.

    - `accepted_at: Optional[str]`

      When the connection request was accepted; null until then.

    - `bounced_at: Optional[str]`

      When the email bounced; null until then.

    - `channel: Literal["EMAIL", "LINKEDIN"]`

      Channel the message went over.

      - `"EMAIL"`

      - `"LINKEDIN"`

    - `contact_id: str`

      ID of the contact.

    - `content: Optional[OutboundMessageContent]`

      Plain-text content of the message. Null when the underlying record is no longer available; not included in list responses.

      - `body: Optional[str]`

        Plain-text body; null for a connection request sent without a note.

      - `subject: Optional[str]`

        Email subject; null for LinkedIn.

    - `created_at: str`

      When the message was created, or when a reply was received. Lists sort by this field, newest first.

    - `direction: Literal["OUTBOUND"]`

      Always `OUTBOUND`.

      - `"OUTBOUND"`

    - `enrollment_id: str`

      ID of the enrollment the message belongs to.

    - `opened_at: Optional[str]`

      When the email was opened; null until then.

    - `read_at: Optional[str]`

      When the LinkedIn message was read; null until then.

    - `reference: Optional[OutboundMessageReference]`

      The email or LinkedIn message record behind this sequence message, readable with <u>[Retrieve an email](/api/resources/email/methods/retrieve)</u> or <u>[Retrieve a message](/api/resources/message/methods/retrieve)</u> under their own scopes; null when there is none.

      - `class OutboundMessageReferenceEmail: …`

        - `id: str`

          ID of the email.

        - `object_type: Literal["email"]`

          Always `email`.

          - `"email"`

      - `class OutboundMessageReferenceMessage: …`

        - `id: str`

          ID of the message.

        - `object_type: Literal["message"]`

          Always `message`.

          - `"message"`

    - `replied_at: Optional[str]`

      When the contact replied to this message; null until then.

    - `sent_at: Optional[str]`

      When the message was sent; null until then.

    - `sequence_step_id: str`

      ID of the step that sent the message or, for a reply, the step it replied to.

    - `sequence_step_type: Literal["EMAIL", "LINKEDIN_MESSAGE", "LINKEDIN_INVITE"]`

      Type of that step.

      - `"EMAIL"`

      - `"LINKEDIN_MESSAGE"`

      - `"LINKEDIN_INVITE"`

    - `status: Literal["AWAITING_REVIEW", "SCHEDULED", "QUEUED", 4 more]`

      `AWAITING_REVIEW` is waiting for approval; `SCHEDULED` is composed and waiting for its send time; `QUEUED` is due and waiting on the sender. `SENT`, `SKIPPED`, `FAILED` and `CANCELLED` are final.

      - `"AWAITING_REVIEW"`

      - `"SCHEDULED"`

      - `"QUEUED"`

      - `"SENT"`

      - `"SKIPPED"`

      - `"FAILED"`

      - `"CANCELLED"`

    - `status_changed_at: str`

      When `status` last changed.

  - `class Reply: …`

    - `id: str`

      Unique identifier of the message.

    - `channel: Literal["EMAIL", "LINKEDIN"]`

      Channel the message went over.

      - `"EMAIL"`

      - `"LINKEDIN"`

    - `contact_id: str`

      ID of the contact.

    - `content: Optional[ReplyContent]`

      Plain-text content of the message. Null when the underlying record is no longer available; not included in list responses.

      - `body: Optional[str]`

        Plain-text body; null for a connection request sent without a note.

      - `subject: Optional[str]`

        Email subject; null for LinkedIn.

    - `created_at: str`

      When the message was created, or when a reply was received. Lists sort by this field, newest first.

    - `direction: Literal["INBOUND"]`

      Always `INBOUND`.

      - `"INBOUND"`

    - `enrollment_id: str`

      ID of the enrollment the message belongs to.

    - `received_at: str`

      When the reply was received.

    - `reference: Optional[ReplyReference]`

      The email or LinkedIn message record behind this sequence message, readable with <u>[Retrieve an email](/api/resources/email/methods/retrieve)</u> or <u>[Retrieve a message](/api/resources/message/methods/retrieve)</u> under their own scopes; null when there is none.

      - `class ReplyReferenceEmail: …`

        - `id: str`

          ID of the email.

        - `object_type: Literal["email"]`

          Always `email`.

          - `"email"`

      - `class ReplyReferenceMessage: …`

        - `id: str`

          ID of the message.

        - `object_type: Literal["message"]`

          Always `message`.

          - `"message"`

    - `sequence_step_id: str`

      ID of the step that sent the message or, for a reply, the step it replied to.

    - `sequence_step_type: Literal["EMAIL", "LINKEDIN_MESSAGE", "LINKEDIN_INVITE"]`

      Type of that step.

      - `"EMAIL"`

      - `"LINKEDIN_MESSAGE"`

      - `"LINKEDIN_INVITE"`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_retrieve_message_response = client.sequence.retrieve_message(
    message_id="messageId",
    id="id",
)
print(sequence_retrieve_message_response)
```

#### Response

```json
{
  "id": "id",
  "acceptedAt": "acceptedAt",
  "bouncedAt": "bouncedAt",
  "channel": "EMAIL",
  "contactId": "contactId",
  "content": {
    "body": "body",
    "subject": "subject"
  },
  "createdAt": "createdAt",
  "direction": "OUTBOUND",
  "enrollmentId": "enrollmentId",
  "openedAt": "openedAt",
  "readAt": "readAt",
  "reference": {
    "id": "id",
    "objectType": "email"
  },
  "repliedAt": "repliedAt",
  "sentAt": "sentAt",
  "sequenceStepId": "sequenceStepId",
  "sequenceStepType": "EMAIL",
  "status": "AWAITING_REVIEW",
  "statusChangedAt": "statusChangedAt"
}
```

## Enroll and cancel contacts

`sequence.update_enrollments(strid, SequenceUpdateEnrollmentsParams**kwargs)  -> SequenceUpdateEnrollmentsResponse`

**post** `/v1/sequences/{id}/enrollments`

Enrolls the contacts in `add` and cancels the open enrollments of the contacts in `remove`, in one request: if any addition is invalid, nothing changes. Send add, remove or both, with at most 25 contact IDs in total; duplicate IDs are ignored, and an ID cannot be in both lists. The response has one result per contact: `enrolled`, `already_enrolled`, `unenrolled`, or `no_active_enrollment` for a removal with nothing open.

A contact already enrolled, paused included, is left as is; one whose earlier enrollment ended is enrolled again. Cancelling stops the contact’s remaining steps and leaves the enrollment readable with status `CANCELLED`. A paused sequence accepts enrollments and sends to them once it is activated; sending starts asynchronously.

Returns 400 `sequence_not_published` for a sequence that has never been published, and 400 `invalid_configuration` with `invalidContacts` naming each contact that cannot be enrolled and why. See <u>[Sequence errors](/using-the-api/errors/#sequence-errors)</u>.

**[Required scope](/using-the-api/scopes/):** `sequences:update`

**[Rate limit category](/using-the-api/rate-limits/):** Write

### Parameters

- `id: str`

  Unique identifier of the sequence.

- `add: Optional[Sequence[str]]`

  Contact IDs to enroll. Open enrollments are unchanged; contacts whose prior enrollment ended are enrolled again.

- `remove: Optional[Sequence[str]]`

  Contact IDs to unenroll. Cancels open enrollments and preserves their history.

### Returns

- `class SequenceUpdateEnrollmentsResponse: …`

  - `results: List[Result]`

    One result per distinct contact, additions first, then removals.

    - `class ResultEnrollmentChanged: …`

      - `contact_id: str`

        ID of the contact.

      - `enrollment_id: str`

        ID of the enrollment the outcome applies to.

      - `outcome: Literal["enrolled", "already_enrolled", "unenrolled"]`

        `enrolled` created the enrollment, `already_enrolled` left an open one as is, `unenrolled` cancelled it.

        - `"enrolled"`

        - `"already_enrolled"`

        - `"unenrolled"`

    - `class ResultNothingToCancel: …`

      - `contact_id: str`

        ID of the contact.

      - `enrollment_id: None`

        Always null.

      - `outcome: Literal["no_active_enrollment"]`

        The contact had no open enrollment to cancel.

        - `"no_active_enrollment"`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_update_enrollments_response = client.sequence.update_enrollments(
    id="id",
)
print(sequence_update_enrollments_response.results)
```

#### Response

```json
{
  "results": [
    {
      "contactId": "contactId",
      "enrollmentId": "enrollmentId",
      "outcome": "enrolled"
    }
  ]
}
```

## Start a sequence test

`sequence.start_test(strid, SequenceStartTestParams**kwargs)  -> SequenceStartTestResponse`

**post** `/v1/sequences/{id}/tests`

Tries the sequence on one contact without sending anything: the contact is enrolled in a test, its steps run back to back with waits skipped, and each message is composed from the contact’s real data and kept as a draft. Use it to check what a step, a template variable or its fallback produces before publishing.

Tests the open draft when there is one or the sequence has never been published, otherwise the published version; `target` in the response says which. Send `expectedVersion` to test exactly the draft you last read. The test continues after the response, so the request returns right away with status `RUNNING`.

Returns 400 `invalid_configuration` with `invalidContacts` naming a contact that does not exist or lacks what a step needs (an email address, a LinkedIn URL or a phone number), or with `issues` when the draft cannot run, 400 `permissions_not_granted` when the draft has agent steps whose permissions are not granted (grant them in Lightfield), 400 `no_selectable_sender` when a channel has no available sender, 409 when `expectedVersion` is not the open draft’s `version`; retrieve the draft and retry, and 429 when a test limit is reached, with a message naming it: the workspace already has 10 tests running (retry once one is `COMPLETED` or `FAILED`), or it started more than 5 tests a minute (retry after `Retry-After` seconds). See <u>[Sequence errors](/using-the-api/errors/#sequence-errors)</u>.

Each call creates a test enrollment and drafts, and agent steps use model credits.

**[Required scope](/using-the-api/scopes/):** `sequences:update`

**[Rate limit category](/using-the-api/rate-limits/):** Write

### Parameters

- `id: str`

  Unique identifier of the sequence.

- `contact_id: str`

  ID of the contact to test the sequence on. The test composes each message from this contact’s real data and sends nothing.

- `expected_version: Optional[str]`

  The open draft’s `version` as last read. When sent, the test runs exactly that draft, and is refused with 409 if the draft has changed or none is open. Omit it to test whatever is open now.

### Returns

- `class SequenceStartTestResponse: …`

  - `id: str`

    ID of the test, an enrollment ID. Use it to read the result.

  - `contact_id: str`

    ID of the contact being tested.

  - `status: Literal["RUNNING"]`

    Always `RUNNING`: the test continues after the response.

    - `"RUNNING"`

  - `target: Literal["DRAFT", "PUBLISHED"]`

    Which version is being tested: the open `DRAFT` when there is one or the sequence was never published, otherwise the `PUBLISHED` version.

    - `"DRAFT"`

    - `"PUBLISHED"`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_start_test_response = client.sequence.start_test(
    id="id",
    contact_id="x",
)
print(sequence_start_test_response.id)
```

#### Response

```json
{
  "id": "id",
  "contactId": "contactId",
  "status": "RUNNING",
  "target": "DRAFT"
}
```

## 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](/api/resources/sequence/methods/startTest): 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](/api/resources/sequence/methods/retrieveEnrollment) for those.

**[Required scope](/using-the-api/scopes/):** `sequences:read`

**[Rate limit category](/using-the-api/rate-limits/):** Read

### Parameters

- `id: str`

  Unique identifier of the sequence.

- `test_id: str`

  The `id` returned when the test was started.

### Returns

- `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.

    - `"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.

        - `"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.

      - `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.

      - `"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`.

      - `"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.

      - `"EMAIL"`

      - `"LINKEDIN_MESSAGE"`

      - `"LINKEDIN_INVITE"`

      - `"WAIT"`

      - `"WAIT_FOR_CONNECTION"`

  - `target: Literal["DRAFT", "PUBLISHED"]`

    Which version was tested.

    - `"DRAFT"`

    - `"PUBLISHED"`

### Example

```python
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)
```

#### Response

```json
{
  "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"
}
```

## Create a sequence

`sequence.create(SequenceCreateParams**kwargs)  -> SequenceCreateResponse`

**post** `/v1/sequences`

Creates a new sequence and its first draft, and returns the draft. The sequence sends nothing until the draft is published and the sequence is activated.

Supports idempotency via the `Idempotency-Key` header.

Returns 400 `invalid_configuration` listing the draft’s problems under `issues`, and 400 `referenced_resource_missing` for a reviewer or sender that does not exist. See <u>[Sequence errors](/using-the-api/errors/#sequence-errors)</u>.

**[Required scope](/using-the-api/scopes/):** `sequences:create`

**[Rate limit category](/using-the-api/rate-limits/):** Write

### Parameters

- `definition: Definition`

  Configuration of the first draft. `description` and `steps` are required.

  - `description: str`

    What this version of the sequence is for.

  - `steps: Iterable[DefinitionStep]`

    The ordered step list.

    - `class DefinitionStepUnionMember0: …`

      - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

        - `"AUTO"`

        - `"FOR_REVIEW"`

      - `name: str`

        Display name of the step.

      - `prompt: str`

        Instructions the agent follows when composing this message.

      - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

        Step type.

        - `"EMAIL"`

        - `"LINKEDIN_MESSAGE"`

      - `mode: Optional[Literal["AGENT"]]`

        How each message is written: `AGENT` composes it from `prompt`; `TEMPLATE` sends `template` to every contact, with its variables filled in. Optional: the content decides, a `prompt` for `AGENT` and a `template` for `TEMPLATE`. A kept template step sent with a `prompt` is refused unless `mode` is `AGENT`, so its template is never dropped by accident.

        - `"AGENT"`

    - `class DefinitionStepUnionMember1: …`

      - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

        - `"AUTO"`

        - `"FOR_REVIEW"`

      - `name: str`

        Display name of the step.

      - `prompt: str`

        Instructions the agent follows when composing this message.

      - `type: Literal["LINKEDIN_INVITE"]`

        Step type.

        - `"LINKEDIN_INVITE"`

      - `include_note: Optional[bool]`

        Whether the connection request carries a note. Defaults to false.

      - `mode: Optional[Literal["AGENT"]]`

        How each message is written: `AGENT` composes it from `prompt`; `TEMPLATE` sends `template` to every contact, with its variables filled in. Optional: the content decides, a `prompt` for `AGENT` and a `template` for `TEMPLATE`. A kept template step sent with a `prompt` is refused unless `mode` is `AGENT`, so its template is never dropped by accident.

        - `"AGENT"`

    - `class DefinitionStepUnionMember2: …`

      - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

        - `"AUTO"`

        - `"FOR_REVIEW"`

      - `name: str`

        Display name of the step.

      - `template: DefinitionStepUnionMember2Template`

        The email every contact receives. Requires template steps for the workspace.

        - `body: str`

          Email body as Markdown; paragraphs, bold, italics, links and lists keep their formatting. Leave out the sign-off and signature, which are added when the message is written. A variable cannot be part of a link address. Write each variable as {{ coalesce(<variable>, "fallback") }}, with a fallback for contacts missing the value. A variable reads a contact field as {attr:<id>}, the contact's first or last name as {col:firstName} or {col:lastName}, the contact's first account's field as {rel:account.<id>}, that account's name as {rel:account.col:name}, and the sender's name or email as {rel:sender.col:name} or {rel:sender.col:email}; a SINGLE_SELECT field reads its option's label, as {attr:<id>.label} or {rel:account.<id>.label}. <id> is the literal id of a CrmContact or CrmAccount field in the CRM schema whose type is one of TEXT, NUMBER, CURRENCY, DATETIME, SINGLE_SELECT, FULL_NAME, EMAIL, URL; never a slug, a name, or an id starting with __synthetic_. Nothing else is a variable: leave such a value out rather than reading a different field. A {{ }} that is not a variable would send as written, so it is refused. A field's <id> may be the `ad_` ID the field-definitions endpoints list.

        - `subject: str`

          Plain-text subject line. Write each variable as {{ coalesce(<variable>, "fallback") }}, with a fallback for contacts missing the value. A variable reads a contact field as {attr:<id>}, the contact's first or last name as {col:firstName} or {col:lastName}, the contact's first account's field as {rel:account.<id>}, that account's name as {rel:account.col:name}, and the sender's name or email as {rel:sender.col:name} or {rel:sender.col:email}; a SINGLE_SELECT field reads its option's label, as {attr:<id>.label} or {rel:account.<id>.label}. <id> is the literal id of a CrmContact or CrmAccount field in the CRM schema whose type is one of TEXT, NUMBER, CURRENCY, DATETIME, SINGLE_SELECT, FULL_NAME, EMAIL, URL; never a slug, a name, or an id starting with __synthetic_. Nothing else is a variable: leave such a value out rather than reading a different field. A {{ }} that is not a variable would send as written, so it is refused. A field's <id> may be the `ad_` ID the field-definitions endpoints list.

      - `type: Literal["EMAIL"]`

        Step type.

        - `"EMAIL"`

      - `mode: Optional[Literal["TEMPLATE"]]`

        How each message is written: `AGENT` composes it from `prompt`; `TEMPLATE` sends `template` to every contact, with its variables filled in. Optional: the content decides, a `prompt` for `AGENT` and a `template` for `TEMPLATE`. A kept template step sent with a `prompt` is refused unless `mode` is `AGENT`, so its template is never dropped by accident.

        - `"TEMPLATE"`

    - `class DefinitionStepUnionMember3: …`

      - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

        - `"AUTO"`

        - `"FOR_REVIEW"`

      - `name: str`

        Display name of the step.

      - `template: DefinitionStepUnionMember3Template`

        The message every contact receives; for an invite, its connection note, sent only with `includeNote` and otherwise left empty. Requires template steps for the workspace.

        - `body: str`

          Plain-text message. Write each variable as {{ coalesce(<variable>, "fallback") }}, with a fallback for contacts missing the value. A variable reads a contact field as {attr:<id>}, the contact's first or last name as {col:firstName} or {col:lastName}, the contact's first account's field as {rel:account.<id>}, that account's name as {rel:account.col:name}, and the sender's name or email as {rel:sender.col:name} or {rel:sender.col:email}; a SINGLE_SELECT field reads its option's label, as {attr:<id>.label} or {rel:account.<id>.label}. <id> is the literal id of a CrmContact or CrmAccount field in the CRM schema whose type is one of TEXT, NUMBER, CURRENCY, DATETIME, SINGLE_SELECT, FULL_NAME, EMAIL, URL; never a slug, a name, or an id starting with __synthetic_. Nothing else is a variable: leave such a value out rather than reading a different field. A {{ }} that is not a variable would send as written, so it is refused. A field's <id> may be the `ad_` ID the field-definitions endpoints list.

      - `type: Literal["LINKEDIN_MESSAGE"]`

        Step type.

        - `"LINKEDIN_MESSAGE"`

      - `mode: Optional[Literal["TEMPLATE"]]`

        How each message is written: `AGENT` composes it from `prompt`; `TEMPLATE` sends `template` to every contact, with its variables filled in. Optional: the content decides, a `prompt` for `AGENT` and a `template` for `TEMPLATE`. A kept template step sent with a `prompt` is refused unless `mode` is `AGENT`, so its template is never dropped by accident.

        - `"TEMPLATE"`

    - `class DefinitionStepUnionMember4: …`

      - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

        - `"AUTO"`

        - `"FOR_REVIEW"`

      - `name: str`

        Display name of the step.

      - `template: DefinitionStepUnionMember4Template`

        The message every contact receives; for an invite, its connection note, sent only with `includeNote` and otherwise left empty. Requires template steps for the workspace.

        - `body: str`

          Plain-text message. Write each variable as {{ coalesce(<variable>, "fallback") }}, with a fallback for contacts missing the value. A variable reads a contact field as {attr:<id>}, the contact's first or last name as {col:firstName} or {col:lastName}, the contact's first account's field as {rel:account.<id>}, that account's name as {rel:account.col:name}, and the sender's name or email as {rel:sender.col:name} or {rel:sender.col:email}; a SINGLE_SELECT field reads its option's label, as {attr:<id>.label} or {rel:account.<id>.label}. <id> is the literal id of a CrmContact or CrmAccount field in the CRM schema whose type is one of TEXT, NUMBER, CURRENCY, DATETIME, SINGLE_SELECT, FULL_NAME, EMAIL, URL; never a slug, a name, or an id starting with __synthetic_. Nothing else is a variable: leave such a value out rather than reading a different field. A {{ }} that is not a variable would send as written, so it is refused. A field's <id> may be the `ad_` ID the field-definitions endpoints list.

      - `type: Literal["LINKEDIN_INVITE"]`

        Step type.

        - `"LINKEDIN_INVITE"`

      - `include_note: Optional[bool]`

        Whether the connection request carries a note. Defaults to false.

      - `mode: Optional[Literal["TEMPLATE"]]`

        How each message is written: `AGENT` composes it from `prompt`; `TEMPLATE` sends `template` to every contact, with its variables filled in. Optional: the content decides, a `prompt` for `AGENT` and a `template` for `TEMPLATE`. A kept template step sent with a `prompt` is refused unless `mode` is `AGENT`, so its template is never dropped by accident.

        - `"TEMPLATE"`

    - `class DefinitionStepUnionMember5: …`

      - `duration: int`

        Length of the wait.

      - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

        - `"WAIT"`

        - `"WAIT_FOR_CONNECTION"`

      - `unit: Literal["DAY", "MINUTE"]`

        Unit of `duration`.

        - `"DAY"`

        - `"MINUTE"`

  - `messaging: Optional[DefinitionMessaging]`

    Messaging inputs that frame every step. Omitted or null fields are left unset.

    - `call_to_action: Optional[str]`

      What the recipient is asked to do.

    - `persona: Optional[str]`

      Who the sequence targets.

    - `trigger: Optional[str]`

      Why the outreach is timely.

    - `value_prop: Optional[str]`

      The value proposition.

  - `pacing: Optional[DefinitionPacing]`

    How the whole sequence paces each step type it sends, keyed by sequence step type. Omitted step types have no daily cap.

    - `email: Optional[DefinitionPacingEmail]`

      Email steps.

      - `daily_limit: Optional[int]`

        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.

    - `linkedin_invite: Optional[DefinitionPacingLinkedinInvite]`

      LinkedIn connection requests.

      - `daily_limit: Optional[int]`

        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.

    - `linkedin_message: Optional[DefinitionPacingLinkedinMessage]`

      LinkedIn messages.

      - `daily_limit: Optional[int]`

        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.

  - `priority: Optional[Literal["HIGH", "NORMAL"]]`

    Send priority relative to other sequences. Defaults to `NORMAL`.

    - `"HIGH"`

    - `"NORMAL"`

  - `send_window: Optional[DefinitionSendWindow]`

    When the sequence may send. Omitted fields take the default: 9:00–17:00, Monday to Friday, UTC.

    - `days_of_week: Optional[Iterable[int]]`

      Days sends may go out, 0 = Sunday.

    - `end_hour: Optional[int]`

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

    - `start_hour: Optional[int]`

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

    - `timezone: Optional[str]`

      IANA timezone of the window.

- `name: str`

  Name of the sequence.

- `reviewers: Optional[Sequence[str]]`

  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. Member IDs of active members. Omit for none.

- `senders: Optional[Sequence[str]]`

  The senders this sequence sends from; new contacts rotate across them. Sender IDs of unarchived senders. Omit for none; activating needs a sender for each channel the steps use.

### Returns

- `class SequenceCreateResponse: …`

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the draft's steps send on.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `definition: Definition`

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

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `name: str`

    Name the sequence takes when the draft is published.

  - `publish_warnings: List[PublishWarning]`

    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: Literal["delay_shortened", "delay_lengthened", "connection_wait_shortened", 18 more]`

      What publishing would change.

      - `"delay_shortened"`

      - `"delay_lengthened"`

      - `"connection_wait_shortened"`

      - `"connection_wait_lengthened"`

      - `"send_schedule_changed"`

      - `"send_configuration_changed"`

      - `"send_priority_changed"`

      - `"senders_changed"`

      - `"email_sender_pool_emptied"`

      - `"linkedin_account_pool_emptied"`

      - `"assigned_sender_removed"`

      - `"delivery_became_automatic"`

      - `"invite_note_enabled"`

      - `"invite_note_disabled"`

      - `"step_inserted"`

      - `"automatic_send_step_inserted"`

      - `"step_removed"`

      - `"step_type_changed"`

      - `"step_order_changed"`

      - `"full_identity_rewrite"`

      - `"low_identity_overlap"`

    - `message: str`

      What would change, in plain language.

    - `severity: Literal["warning", "destructive"]`

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

      - `"warning"`

      - `"destructive"`

    - `step_ids: List[str]`

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

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    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: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `sequence_id: str`

    The sequence this draft belongs to.

  - `updated_at: str`

    When the draft last changed.

  - `version: str`

    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.

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_create_response = client.sequence.create(
    definition={
        "description": "x",
        "steps": [{
            "delivery_mode": "AUTO",
            "name": "x",
            "prompt": "x",
            "type": "EMAIL",
        }],
    },
    name="x",
)
print(sequence_create_response.channels)
```

#### Response

```json
{
  "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"
}
```

## Activate a sequence

`sequence.activate(strid, SequenceActivateParams**kwargs)  -> SequenceActivateResponse`

**post** `/v1/sequences/{id}/activate`

Starts sending a published sequence to its enrolled contacts and returns it. Requires a published version and an available sender for each channel the steps use; senders are added through the draft. An active sequence is returned unchanged. The sequence’s status changes immediately; its enrollments’ statuses follow asynchronously. Returns 400 `sequence_not_published` before the first publish, 400 `no_selectable_sender` when a channel has no available sender, and 409 when the sequence changed while the request ran: re-read it to see the change, then retry.

**[Required scope](/using-the-api/scopes/):** `sequences:update`

**[Rate limit category](/using-the-api/rate-limits/):** Write

### Parameters

- `id: str`

  Unique identifier of the sequence.

- `body: Optional[Body]`

### Returns

- `class SequenceActivateResponse: …`

  - `id: str`

    Unique identifier of the sequence.

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the published steps send on; empty before the first publish.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `created_at: str`

    ISO 8601 creation timestamp.

  - `definition: Optional[Definition]`

    Published configuration, or null before the first publish.

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `first_activated_at: Optional[str]`

    When the sequence was first activated.

  - `last_activated_at: Optional[str]`

    When the sequence was most recently activated.

  - `name: str`

    Name of the sequence.

  - `object_type: Literal["sequence"]`

    Always `sequence`.

    - `"sequence"`

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    The senders this sequence sends from; new contacts rotate across them. An archived sender stays listed but never sends; any change to the list drops it.

    - `id: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `status: Literal["DRAFT", "ACTIVE", "DEACTIVATED"]`

    `DRAFT` has not been published; `ACTIVE` is enabled for sending; `DEACTIVATED` is published but paused.

    - `"DRAFT"`

    - `"ACTIVE"`

    - `"DEACTIVATED"`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_activate_response = client.sequence.activate(
    id="id",
)
print(sequence_activate_response.id)
```

#### Response

```json
{
  "id": "id",
  "channels": [
    "EMAIL"
  ],
  "createdAt": "createdAt",
  "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"
      }
    ]
  },
  "firstActivatedAt": "firstActivatedAt",
  "lastActivatedAt": "lastActivatedAt",
  "name": "name",
  "objectType": "sequence",
  "reviewers": [
    {
      "id": "x",
      "objectType": "member"
    }
  ],
  "senders": [
    {
      "id": "x",
      "objectType": "sender"
    }
  ],
  "status": "DRAFT"
}
```

## Deactivate a sequence

`sequence.deactivate(strid, SequenceDeactivateParams**kwargs)  -> SequenceDeactivateResponse`

**post** `/v1/sequences/{id}/deactivate`

Pauses sending for a published sequence and returns it. Enrollments stay in place and resume when the sequence is activated again; a paused sequence is returned unchanged. The sequence’s status changes immediately; its enrollments’ statuses follow asynchronously. Returns 400 `sequence_not_published` before the first publish, and 409 when the sequence changed while the request ran: re-read it to see the change, then retry.

**[Required scope](/using-the-api/scopes/):** `sequences:update`

**[Rate limit category](/using-the-api/rate-limits/):** Write

### Parameters

- `id: str`

  Unique identifier of the sequence.

- `body: Optional[Body]`

### Returns

- `class SequenceDeactivateResponse: …`

  - `id: str`

    Unique identifier of the sequence.

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the published steps send on; empty before the first publish.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `created_at: str`

    ISO 8601 creation timestamp.

  - `definition: Optional[Definition]`

    Published configuration, or null before the first publish.

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `first_activated_at: Optional[str]`

    When the sequence was first activated.

  - `last_activated_at: Optional[str]`

    When the sequence was most recently activated.

  - `name: str`

    Name of the sequence.

  - `object_type: Literal["sequence"]`

    Always `sequence`.

    - `"sequence"`

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    The senders this sequence sends from; new contacts rotate across them. An archived sender stays listed but never sends; any change to the list drops it.

    - `id: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `status: Literal["DRAFT", "ACTIVE", "DEACTIVATED"]`

    `DRAFT` has not been published; `ACTIVE` is enabled for sending; `DEACTIVATED` is published but paused.

    - `"DRAFT"`

    - `"ACTIVE"`

    - `"DEACTIVATED"`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_deactivate_response = client.sequence.deactivate(
    id="id",
)
print(sequence_deactivate_response.id)
```

#### Response

```json
{
  "id": "id",
  "channels": [
    "EMAIL"
  ],
  "createdAt": "createdAt",
  "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"
      }
    ]
  },
  "firstActivatedAt": "firstActivatedAt",
  "lastActivatedAt": "lastActivatedAt",
  "name": "name",
  "objectType": "sequence",
  "reviewers": [
    {
      "id": "x",
      "objectType": "member"
    }
  ],
  "senders": [
    {
      "id": "x",
      "objectType": "sender"
    }
  ],
  "status": "DRAFT"
}
```

## Retrieve a sequence draft

`sequence.retrieve_draft(strid)  -> SequenceRetrieveDraftResponse`

**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](/using-the-api/scopes/):** `sequences:read`

**[Rate limit category](/using-the-api/rate-limits/):** Read

### Parameters

- `id: str`

  Unique identifier of the sequence.

### Returns

- `class SequenceRetrieveDraftResponse: …`

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the draft's steps send on.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `definition: Definition`

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

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `name: str`

    Name the sequence takes when the draft is published.

  - `publish_warnings: List[PublishWarning]`

    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: Literal["delay_shortened", "delay_lengthened", "connection_wait_shortened", 18 more]`

      What publishing would change.

      - `"delay_shortened"`

      - `"delay_lengthened"`

      - `"connection_wait_shortened"`

      - `"connection_wait_lengthened"`

      - `"send_schedule_changed"`

      - `"send_configuration_changed"`

      - `"send_priority_changed"`

      - `"senders_changed"`

      - `"email_sender_pool_emptied"`

      - `"linkedin_account_pool_emptied"`

      - `"assigned_sender_removed"`

      - `"delivery_became_automatic"`

      - `"invite_note_enabled"`

      - `"invite_note_disabled"`

      - `"step_inserted"`

      - `"automatic_send_step_inserted"`

      - `"step_removed"`

      - `"step_type_changed"`

      - `"step_order_changed"`

      - `"full_identity_rewrite"`

      - `"low_identity_overlap"`

    - `message: str`

      What would change, in plain language.

    - `severity: Literal["warning", "destructive"]`

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

      - `"warning"`

      - `"destructive"`

    - `step_ids: List[str]`

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

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    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: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `sequence_id: str`

    The sequence this draft belongs to.

  - `updated_at: str`

    When the draft last changed.

  - `version: str`

    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.

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_retrieve_draft_response = client.sequence.retrieve_draft(
    "id",
)
print(sequence_retrieve_draft_response.channels)
```

#### Response

```json
{
  "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"
}
```

## Update a sequence draft

`sequence.update_draft(strid, SequenceUpdateDraftParams**kwargs)  -> SequenceUpdateDraftResponse`

**post** `/v1/sequences/{id}/draft`

Saves changes to the sequence’s open draft, or opens one from the published version when none is open. Only the fields sent are changed; `definition.steps` replaces the whole step list. Changes take effect when the draft is published. See <u>[Using sequences with the API](/sequences/using-the-api#editing-a-draft)</u> for the draft and version model.

Returns 409 when `expectedVersion` is not the open draft’s `version`, or for a `steps` save while the draft has unfinished edits in Lightfield; retrieve the draft and retry. A refused save changes nothing: 400 `invalid_configuration` lists every problem under `issues`, 400 `referenced_resource_missing` names a reviewer or sender that does not exist, and a value outside its field’s documented bounds returns 400 naming the field in `param`. See <u>[Sequence errors](/using-the-api/errors/#sequence-errors)</u>.

**[Required scope](/using-the-api/scopes/):** `sequences:update`

**[Rate limit category](/using-the-api/rate-limits/):** Write

### Parameters

- `id: str`

  Unique identifier of the sequence.

- `definition: Optional[Definition]`

  Fields to change. Omitted fields are unchanged.

  - `description: Optional[str]`

    What this version of the sequence is for.

  - `messaging: Optional[DefinitionMessaging]`

    Messaging inputs that frame every step. Omitted fields are unchanged; null clears a field.

    - `call_to_action: Optional[str]`

      What the recipient is asked to do.

    - `persona: Optional[str]`

      Who the sequence targets.

    - `trigger: Optional[str]`

      Why the outreach is timely.

    - `value_prop: Optional[str]`

      The value proposition.

  - `pacing: Optional[DefinitionPacing]`

    How the whole sequence paces each step type it sends, keyed by sequence step type. Omitted step types are unchanged.

    - `email: Optional[DefinitionPacingEmail]`

      Email steps.

      - `daily_limit: Optional[int]`

        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.

    - `linkedin_invite: Optional[DefinitionPacingLinkedinInvite]`

      LinkedIn connection requests.

      - `daily_limit: Optional[int]`

        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.

    - `linkedin_message: Optional[DefinitionPacingLinkedinMessage]`

      LinkedIn messages.

      - `daily_limit: Optional[int]`

        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.

  - `priority: Optional[Literal["HIGH", "NORMAL"]]`

    Send priority relative to other sequences.

    - `"HIGH"`

    - `"NORMAL"`

  - `send_window: Optional[DefinitionSendWindow]`

    When the sequence may send. Omitted fields are unchanged.

    - `days_of_week: Optional[Iterable[int]]`

      Days sends may go out, 0 = Sunday.

    - `end_hour: Optional[int]`

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

    - `start_hour: Optional[int]`

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

    - `timezone: Optional[str]`

      IANA timezone of the window.

  - `steps: Optional[Iterable[DefinitionStep]]`

    The complete ordered step list, replacing the current one. Keep a step by sending its `id`; omit `id` for a new step.

    - `class DefinitionStepUnionMember0: …`

      - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

        - `"AUTO"`

        - `"FOR_REVIEW"`

      - `name: str`

        Display name of the step.

      - `prompt: str`

        Instructions the agent follows when composing this message.

      - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

        Step type.

        - `"EMAIL"`

        - `"LINKEDIN_MESSAGE"`

      - `id: Optional[str]`

        ID of a step in the current draft to keep. Omit for a new step. Kept steps must stay in their relative order and keep their type.

      - `mode: Optional[Literal["AGENT"]]`

        How each message is written: `AGENT` composes it from `prompt`; `TEMPLATE` sends `template` to every contact, with its variables filled in. Optional: the content decides, a `prompt` for `AGENT` and a `template` for `TEMPLATE`. A kept template step sent with a `prompt` is refused unless `mode` is `AGENT`, so its template is never dropped by accident.

        - `"AGENT"`

    - `class DefinitionStepUnionMember1: …`

      - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

        - `"AUTO"`

        - `"FOR_REVIEW"`

      - `name: str`

        Display name of the step.

      - `prompt: str`

        Instructions the agent follows when composing this message.

      - `type: Literal["LINKEDIN_INVITE"]`

        Step type.

        - `"LINKEDIN_INVITE"`

      - `id: Optional[str]`

        ID of a step in the current draft to keep. Omit for a new step. Kept steps must stay in their relative order and keep their type.

      - `include_note: Optional[bool]`

        Whether the connection request carries a note. Omit to keep the current setting; a new step defaults to false.

      - `mode: Optional[Literal["AGENT"]]`

        How each message is written: `AGENT` composes it from `prompt`; `TEMPLATE` sends `template` to every contact, with its variables filled in. Optional: the content decides, a `prompt` for `AGENT` and a `template` for `TEMPLATE`. A kept template step sent with a `prompt` is refused unless `mode` is `AGENT`, so its template is never dropped by accident.

        - `"AGENT"`

    - `class DefinitionStepUnionMember2: …`

      - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

        - `"AUTO"`

        - `"FOR_REVIEW"`

      - `name: str`

        Display name of the step.

      - `template: DefinitionStepUnionMember2Template`

        The email every contact receives. Requires template steps for the workspace.

        - `body: str`

          Email body as Markdown; paragraphs, bold, italics, links and lists keep their formatting. Leave out the sign-off and signature, which are added when the message is written. A variable cannot be part of a link address. Write each variable as {{ coalesce(<variable>, "fallback") }}, with a fallback for contacts missing the value. A variable reads a contact field as {attr:<id>}, the contact's first or last name as {col:firstName} or {col:lastName}, the contact's first account's field as {rel:account.<id>}, that account's name as {rel:account.col:name}, and the sender's name or email as {rel:sender.col:name} or {rel:sender.col:email}; a SINGLE_SELECT field reads its option's label, as {attr:<id>.label} or {rel:account.<id>.label}. <id> is the literal id of a CrmContact or CrmAccount field in the CRM schema whose type is one of TEXT, NUMBER, CURRENCY, DATETIME, SINGLE_SELECT, FULL_NAME, EMAIL, URL; never a slug, a name, or an id starting with __synthetic_. Nothing else is a variable: leave such a value out rather than reading a different field. A {{ }} that is not a variable would send as written, so it is refused. A field's <id> may be the `ad_` ID the field-definitions endpoints list.

        - `subject: str`

          Plain-text subject line. Write each variable as {{ coalesce(<variable>, "fallback") }}, with a fallback for contacts missing the value. A variable reads a contact field as {attr:<id>}, the contact's first or last name as {col:firstName} or {col:lastName}, the contact's first account's field as {rel:account.<id>}, that account's name as {rel:account.col:name}, and the sender's name or email as {rel:sender.col:name} or {rel:sender.col:email}; a SINGLE_SELECT field reads its option's label, as {attr:<id>.label} or {rel:account.<id>.label}. <id> is the literal id of a CrmContact or CrmAccount field in the CRM schema whose type is one of TEXT, NUMBER, CURRENCY, DATETIME, SINGLE_SELECT, FULL_NAME, EMAIL, URL; never a slug, a name, or an id starting with __synthetic_. Nothing else is a variable: leave such a value out rather than reading a different field. A {{ }} that is not a variable would send as written, so it is refused. A field's <id> may be the `ad_` ID the field-definitions endpoints list.

      - `type: Literal["EMAIL"]`

        Step type.

        - `"EMAIL"`

      - `id: Optional[str]`

        ID of a step in the current draft to keep. Omit for a new step. Kept steps must stay in their relative order and keep their type.

      - `mode: Optional[Literal["TEMPLATE"]]`

        How each message is written: `AGENT` composes it from `prompt`; `TEMPLATE` sends `template` to every contact, with its variables filled in. Optional: the content decides, a `prompt` for `AGENT` and a `template` for `TEMPLATE`. A kept template step sent with a `prompt` is refused unless `mode` is `AGENT`, so its template is never dropped by accident.

        - `"TEMPLATE"`

    - `class DefinitionStepUnionMember3: …`

      - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

        - `"AUTO"`

        - `"FOR_REVIEW"`

      - `name: str`

        Display name of the step.

      - `template: DefinitionStepUnionMember3Template`

        The message every contact receives; for an invite, its connection note, sent only with `includeNote` and otherwise left empty. Requires template steps for the workspace.

        - `body: str`

          Plain-text message. Write each variable as {{ coalesce(<variable>, "fallback") }}, with a fallback for contacts missing the value. A variable reads a contact field as {attr:<id>}, the contact's first or last name as {col:firstName} or {col:lastName}, the contact's first account's field as {rel:account.<id>}, that account's name as {rel:account.col:name}, and the sender's name or email as {rel:sender.col:name} or {rel:sender.col:email}; a SINGLE_SELECT field reads its option's label, as {attr:<id>.label} or {rel:account.<id>.label}. <id> is the literal id of a CrmContact or CrmAccount field in the CRM schema whose type is one of TEXT, NUMBER, CURRENCY, DATETIME, SINGLE_SELECT, FULL_NAME, EMAIL, URL; never a slug, a name, or an id starting with __synthetic_. Nothing else is a variable: leave such a value out rather than reading a different field. A {{ }} that is not a variable would send as written, so it is refused. A field's <id> may be the `ad_` ID the field-definitions endpoints list.

      - `type: Literal["LINKEDIN_MESSAGE"]`

        Step type.

        - `"LINKEDIN_MESSAGE"`

      - `id: Optional[str]`

        ID of a step in the current draft to keep. Omit for a new step. Kept steps must stay in their relative order and keep their type.

      - `mode: Optional[Literal["TEMPLATE"]]`

        How each message is written: `AGENT` composes it from `prompt`; `TEMPLATE` sends `template` to every contact, with its variables filled in. Optional: the content decides, a `prompt` for `AGENT` and a `template` for `TEMPLATE`. A kept template step sent with a `prompt` is refused unless `mode` is `AGENT`, so its template is never dropped by accident.

        - `"TEMPLATE"`

    - `class DefinitionStepUnionMember4: …`

      - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

        - `"AUTO"`

        - `"FOR_REVIEW"`

      - `name: str`

        Display name of the step.

      - `template: DefinitionStepUnionMember4Template`

        The message every contact receives; for an invite, its connection note, sent only with `includeNote` and otherwise left empty. Requires template steps for the workspace.

        - `body: str`

          Plain-text message. Write each variable as {{ coalesce(<variable>, "fallback") }}, with a fallback for contacts missing the value. A variable reads a contact field as {attr:<id>}, the contact's first or last name as {col:firstName} or {col:lastName}, the contact's first account's field as {rel:account.<id>}, that account's name as {rel:account.col:name}, and the sender's name or email as {rel:sender.col:name} or {rel:sender.col:email}; a SINGLE_SELECT field reads its option's label, as {attr:<id>.label} or {rel:account.<id>.label}. <id> is the literal id of a CrmContact or CrmAccount field in the CRM schema whose type is one of TEXT, NUMBER, CURRENCY, DATETIME, SINGLE_SELECT, FULL_NAME, EMAIL, URL; never a slug, a name, or an id starting with __synthetic_. Nothing else is a variable: leave such a value out rather than reading a different field. A {{ }} that is not a variable would send as written, so it is refused. A field's <id> may be the `ad_` ID the field-definitions endpoints list.

      - `type: Literal["LINKEDIN_INVITE"]`

        Step type.

        - `"LINKEDIN_INVITE"`

      - `id: Optional[str]`

        ID of a step in the current draft to keep. Omit for a new step. Kept steps must stay in their relative order and keep their type.

      - `include_note: Optional[bool]`

        Whether the connection request carries a note. Omit to keep the current setting; a new step defaults to false.

      - `mode: Optional[Literal["TEMPLATE"]]`

        How each message is written: `AGENT` composes it from `prompt`; `TEMPLATE` sends `template` to every contact, with its variables filled in. Optional: the content decides, a `prompt` for `AGENT` and a `template` for `TEMPLATE`. A kept template step sent with a `prompt` is refused unless `mode` is `AGENT`, so its template is never dropped by accident.

        - `"TEMPLATE"`

    - `class DefinitionStepUnionMember5: …`

      - `duration: int`

        Length of the wait.

      - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

        - `"WAIT"`

        - `"WAIT_FOR_CONNECTION"`

      - `unit: Literal["DAY", "MINUTE"]`

        Unit of `duration`.

        - `"DAY"`

        - `"MINUTE"`

      - `id: Optional[str]`

        ID of a step in the current draft to keep. Omit for a new step. Kept steps must stay in their relative order and keep their type.

- `expected_version: Optional[str]`

  The open draft’s `version` as last read. Required when a draft is open; omit it only when none is, to start one from the published version.

- `name: Optional[str]`

  Name of the sequence.

- `reviewers: Optional[Reviewers]`

  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. Changes the list by adding and removing members; omit to keep it.

  - `add: Optional[Sequence[str]]`

    Member IDs of active members to add. A member already listed is unchanged.

  - `remove: Optional[Sequence[str]]`

    Member IDs to remove, including members who have left the workspace. A member not listed is unchanged.

- `senders: Optional[Senders]`

  The senders this sequence sends from; new contacts rotate across them. Changes the list by adding and removing senders; omit to keep it.

  - `add: Optional[Sequence[str]]`

    Sender IDs of unarchived senders to add. A sender already listed is unchanged.

  - `remove: Optional[Sequence[str]]`

    Sender IDs to remove, including archived senders. A sender not listed is unchanged.

### Returns

- `class SequenceUpdateDraftResponse: …`

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the draft's steps send on.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `definition: Definition`

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

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `name: str`

    Name the sequence takes when the draft is published.

  - `publish_warnings: List[PublishWarning]`

    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: Literal["delay_shortened", "delay_lengthened", "connection_wait_shortened", 18 more]`

      What publishing would change.

      - `"delay_shortened"`

      - `"delay_lengthened"`

      - `"connection_wait_shortened"`

      - `"connection_wait_lengthened"`

      - `"send_schedule_changed"`

      - `"send_configuration_changed"`

      - `"send_priority_changed"`

      - `"senders_changed"`

      - `"email_sender_pool_emptied"`

      - `"linkedin_account_pool_emptied"`

      - `"assigned_sender_removed"`

      - `"delivery_became_automatic"`

      - `"invite_note_enabled"`

      - `"invite_note_disabled"`

      - `"step_inserted"`

      - `"automatic_send_step_inserted"`

      - `"step_removed"`

      - `"step_type_changed"`

      - `"step_order_changed"`

      - `"full_identity_rewrite"`

      - `"low_identity_overlap"`

    - `message: str`

      What would change, in plain language.

    - `severity: Literal["warning", "destructive"]`

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

      - `"warning"`

      - `"destructive"`

    - `step_ids: List[str]`

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

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    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: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `sequence_id: str`

    The sequence this draft belongs to.

  - `updated_at: str`

    When the draft last changed.

  - `version: str`

    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.

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_update_draft_response = client.sequence.update_draft(
    id="id",
)
print(sequence_update_draft_response.channels)
```

#### Response

```json
{
  "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"
}
```

## Publish a sequence draft

`sequence.publish_draft(strid, SequencePublishDraftParams**kwargs)  -> SequencePublishDraftResponse`

**post** `/v1/sequences/{id}/draft/publish`

Publishes the open draft at `expectedVersion` and returns the sequence. A first publish leaves the sequence `DEACTIVATED`; activate it to start sending. Contacts already enrolled continue on the new version.

A refused publish changes nothing. Returns 400 `invalid_configuration` with the problems under `issues`, 400 `permissions_not_granted` or `no_selectable_sender` when the steps cannot send yet, 404 `draft_not_found` when no draft is open, and 409 when `expectedVersion` is not the open draft’s `version`; retrieve the draft and retry. See <u>[Sequence errors](/using-the-api/errors/#sequence-errors)</u> for what each code means and how to resolve it.

**[Required scope](/using-the-api/scopes/):** `sequences:update`

**[Rate limit category](/using-the-api/rate-limits/):** Write

### Parameters

- `id: str`

  Unique identifier of the sequence.

- `expected_version: str`

  The open draft’s `version` as last read.

### Returns

- `class SequencePublishDraftResponse: …`

  - `id: str`

    Unique identifier of the sequence.

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the published steps send on; empty before the first publish.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `created_at: str`

    ISO 8601 creation timestamp.

  - `definition: Optional[Definition]`

    Published configuration, or null before the first publish.

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `first_activated_at: Optional[str]`

    When the sequence was first activated.

  - `last_activated_at: Optional[str]`

    When the sequence was most recently activated.

  - `name: str`

    Name of the sequence.

  - `object_type: Literal["sequence"]`

    Always `sequence`.

    - `"sequence"`

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    The senders this sequence sends from; new contacts rotate across them. An archived sender stays listed but never sends; any change to the list drops it.

    - `id: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `status: Literal["DRAFT", "ACTIVE", "DEACTIVATED"]`

    `DRAFT` has not been published; `ACTIVE` is enabled for sending; `DEACTIVATED` is published but paused.

    - `"DRAFT"`

    - `"ACTIVE"`

    - `"DEACTIVATED"`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_publish_draft_response = client.sequence.publish_draft(
    id="id",
    expected_version="expectedVersion",
)
print(sequence_publish_draft_response.id)
```

#### Response

```json
{
  "id": "id",
  "channels": [
    "EMAIL"
  ],
  "createdAt": "createdAt",
  "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"
      }
    ]
  },
  "firstActivatedAt": "firstActivatedAt",
  "lastActivatedAt": "lastActivatedAt",
  "name": "name",
  "objectType": "sequence",
  "reviewers": [
    {
      "id": "x",
      "objectType": "member"
    }
  ],
  "senders": [
    {
      "id": "x",
      "objectType": "sender"
    }
  ],
  "status": "DRAFT"
}
```

## List template variables

`sequence.list_template_variables()  -> SequenceListTemplateVariablesResponse`

**get** `/v1/sequences/template/variables`

Lists the variables a sequence template may use: the first and last name, the contact’s and its first account’s fields of a type a message can print, and the sender’s name and email. Use an entry’s `ref` in a send step’s subject or body. A variable needs a fallback for contacts missing the value: `{{ {attr:ad_…} }}` is written `{{ coalesce({attr:ad_…}, "fallback") }}`, and one without a fallback is refused when the draft is saved. Anything else inside `{{ }}` is refused too.

**[Required scopes](/using-the-api/scopes/):** `sequences:read`, `contacts:read` and `accounts:read`

**[Rate limit category](/using-the-api/rate-limits/):** Read

### Returns

- `class SequenceListTemplateVariablesResponse: …`

  - `data: List[Data]`

    - `field: Optional[DataField]`

      The field the variable reads; null for built-in variables.

      - `id: str`

        The `ad_` id of the field, as the field-definitions endpoints list it.

      - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 12 more]`

        Type of the field.

        - `"ADDRESS"`

        - `"CHECKBOX"`

        - `"CURRENCY"`

        - `"DATETIME"`

        - `"EMAIL"`

        - `"FULL_NAME"`

        - `"MARKDOWN"`

        - `"MULTI_SELECT"`

        - `"NUMBER"`

        - `"SINGLE_SELECT"`

        - `"SOCIAL_HANDLE"`

        - `"TELEPHONE"`

        - `"TEXT"`

        - `"URL"`

        - `"HTML"`

    - `group: Literal["contact", "account", "sender"]`

      Whose value the variable prints: the enrolled contact, its first account, or the step’s sender.

      - `"contact"`

      - `"account"`

      - `"sender"`

    - `label: str`

      Name of the variable, as the editor shows it.

    - `ref: str`

      The variable, e.g. `{{ {attr:ad_…} }}`. A variable needs a fallback for contacts missing the value: `{{ {attr:ad_…} }}` is written `{{ coalesce({attr:ad_…}, "fallback") }}`, and one without a fallback is refused when the draft is saved.

  - `object: Literal["list"]`

    - `"list"`

  - `total_count: int`

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_list_template_variables_response = client.sequence.list_template_variables()
print(sequence_list_template_variables_response.data)
```

#### Response

```json
{
  "data": [
    {
      "field": {
        "id": "id",
        "valueType": "ADDRESS"
      },
      "group": "contact",
      "label": "label",
      "ref": "ref"
    }
  ],
  "object": "list",
  "totalCount": -9007199254740991
}
```

## Discard a sequence draft

`sequence.discard_draft(strid, SequenceDiscardDraftParams**kwargs)  -> SequenceDiscardDraftResponse`

**post** `/v1/sequences/{id}/draft/discard`

Discards the open draft at `expectedVersion`. A published sequence keeps its published version. A sequence that has never been published is deleted with its draft, and `sequenceDeleted` is true. Returns 404 `draft_not_found` when no draft is open, and 409 when `expectedVersion` is not the open draft’s `version`; retrieve the draft and retry.

**[Required scope](/using-the-api/scopes/):** `sequences:update`

**[Rate limit category](/using-the-api/rate-limits/):** Write

### Parameters

- `id: str`

  Unique identifier of the sequence.

- `expected_version: str`

  The open draft’s `version` as last read.

### Returns

- `class SequenceDiscardDraftResponse: …`

  - `sequence_deleted: bool`

    True when the sequence had never been published, so discarding its only draft deleted it.

  - `sequence_id: str`

    The sequence whose draft was discarded.

### Example

```python
from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
sequence_discard_draft_response = client.sequence.discard_draft(
    id="id",
    expected_version="expectedVersion",
)
print(sequence_discard_draft_response.sequence_deleted)
```

#### Response

```json
{
  "sequenceDeleted": true,
  "sequenceId": "sequenceId"
}
```

## Domain Types

### Sequence Activate Response

- `class SequenceActivateResponse: …`

  - `id: str`

    Unique identifier of the sequence.

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the published steps send on; empty before the first publish.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `created_at: str`

    ISO 8601 creation timestamp.

  - `definition: Optional[Definition]`

    Published configuration, or null before the first publish.

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `first_activated_at: Optional[str]`

    When the sequence was first activated.

  - `last_activated_at: Optional[str]`

    When the sequence was most recently activated.

  - `name: str`

    Name of the sequence.

  - `object_type: Literal["sequence"]`

    Always `sequence`.

    - `"sequence"`

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    The senders this sequence sends from; new contacts rotate across them. An archived sender stays listed but never sends; any change to the list drops it.

    - `id: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `status: Literal["DRAFT", "ACTIVE", "DEACTIVATED"]`

    `DRAFT` has not been published; `ACTIVE` is enabled for sending; `DEACTIVATED` is published but paused.

    - `"DRAFT"`

    - `"ACTIVE"`

    - `"DEACTIVATED"`

### Sequence Create Response

- `class SequenceCreateResponse: …`

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the draft's steps send on.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `definition: Definition`

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

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `name: str`

    Name the sequence takes when the draft is published.

  - `publish_warnings: List[PublishWarning]`

    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: Literal["delay_shortened", "delay_lengthened", "connection_wait_shortened", 18 more]`

      What publishing would change.

      - `"delay_shortened"`

      - `"delay_lengthened"`

      - `"connection_wait_shortened"`

      - `"connection_wait_lengthened"`

      - `"send_schedule_changed"`

      - `"send_configuration_changed"`

      - `"send_priority_changed"`

      - `"senders_changed"`

      - `"email_sender_pool_emptied"`

      - `"linkedin_account_pool_emptied"`

      - `"assigned_sender_removed"`

      - `"delivery_became_automatic"`

      - `"invite_note_enabled"`

      - `"invite_note_disabled"`

      - `"step_inserted"`

      - `"automatic_send_step_inserted"`

      - `"step_removed"`

      - `"step_type_changed"`

      - `"step_order_changed"`

      - `"full_identity_rewrite"`

      - `"low_identity_overlap"`

    - `message: str`

      What would change, in plain language.

    - `severity: Literal["warning", "destructive"]`

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

      - `"warning"`

      - `"destructive"`

    - `step_ids: List[str]`

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

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    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: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `sequence_id: str`

    The sequence this draft belongs to.

  - `updated_at: str`

    When the draft last changed.

  - `version: str`

    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.

### Sequence Deactivate Response

- `class SequenceDeactivateResponse: …`

  - `id: str`

    Unique identifier of the sequence.

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the published steps send on; empty before the first publish.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `created_at: str`

    ISO 8601 creation timestamp.

  - `definition: Optional[Definition]`

    Published configuration, or null before the first publish.

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `first_activated_at: Optional[str]`

    When the sequence was first activated.

  - `last_activated_at: Optional[str]`

    When the sequence was most recently activated.

  - `name: str`

    Name of the sequence.

  - `object_type: Literal["sequence"]`

    Always `sequence`.

    - `"sequence"`

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    The senders this sequence sends from; new contacts rotate across them. An archived sender stays listed but never sends; any change to the list drops it.

    - `id: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `status: Literal["DRAFT", "ACTIVE", "DEACTIVATED"]`

    `DRAFT` has not been published; `ACTIVE` is enabled for sending; `DEACTIVATED` is published but paused.

    - `"DRAFT"`

    - `"ACTIVE"`

    - `"DEACTIVATED"`

### Sequence Discard Draft Response

- `class SequenceDiscardDraftResponse: …`

  - `sequence_deleted: bool`

    True when the sequence had never been published, so discarding its only draft deleted it.

  - `sequence_id: str`

    The sequence whose draft was discarded.

### Sequence List Enrollments Response

- `class SequenceListEnrollmentsResponse: …`

  - `data: List[Data]`

    - `id: str`

      Unique identifier of the enrollment.

    - `cancelled_at: Optional[str]`

      When the enrollment was cancelled, or null if it was not.

    - `completed_at: Optional[str]`

      When the enrollment completed, or null if it has not.

    - `contact_id: str`

      ID of the enrolled contact.

    - `current_step_id: Optional[str]`

      ID of the step the contact is on, matching `definition.steps`; null when the contact has no current step the API returns.

    - `enrolled_at: str`

      When the contact was enrolled.

    - `enrolled_by: Optional[str]`

      Member ID of whoever enrolled the contact; null when they are no longer a member or the enrollment was automatic.

    - `last_activity_at: Optional[str]`

      When `lastActivityKind` happened; null when there has been no activity.

    - `last_activity_kind: Optional[Literal["SENT", "OPENED", "REPLIED", 4 more]]`

      The latest activity on the enrollment. A reply or bounce that ended the enrollment is reported over a later open.

      - `"SENT"`

      - `"OPENED"`

      - `"REPLIED"`

      - `"BOUNCED"`

      - `"INVITED"`

      - `"CONNECTED"`

      - `"SEEN"`

    - `next_send_at: Optional[str]`

      Estimated time of the next send, from the cadence, send window, pacing and sender; queue order and random gaps can push it later. Null while a message awaits review or is sending, while paused, or when it cannot be estimated.

    - `remaining_sends: Optional[int]`

      Email and LinkedIn steps not yet sent, connection requests included.

    - `replied_at: Optional[str]`

      When the contact first replied, on email or LinkedIn; null if they have not.

    - `status: Optional[Literal["ACTIVE", "AWAITING_REVIEW", "NEEDS_ATTENTION", 5 more]]`

      `ACTIVE` is progressing; `AWAITING_REVIEW` has a message waiting for approval; `NEEDS_ATTENTION` is held by a failed step, a held draft or an unavailable sender; `PAUSED` is stopped because the sequence is deactivated or it was paused in Lightfield. `REPLIED`, `COMPLETED`, `CANCELLED` and `FAILED` are final.

      - `"ACTIVE"`

      - `"AWAITING_REVIEW"`

      - `"NEEDS_ATTENTION"`

      - `"REPLIED"`

      - `"COMPLETED"`

      - `"PAUSED"`

      - `"CANCELLED"`

      - `"FAILED"`

  - `object: Literal["list"]`

    - `"list"`

  - `total_count: int`

### Sequence List Messages Response

- `class SequenceListMessagesResponse: …`

  - `data: List[Data]`

    - `class DataOutboundMessage: …`

      - `id: str`

        Unique identifier of the message.

      - `accepted_at: Optional[str]`

        When the connection request was accepted; null until then.

      - `bounced_at: Optional[str]`

        When the email bounced; null until then.

      - `channel: Literal["EMAIL", "LINKEDIN"]`

        Channel the message went over.

        - `"EMAIL"`

        - `"LINKEDIN"`

      - `contact_id: str`

        ID of the contact.

      - `created_at: str`

        When the message was created, or when a reply was received. Lists sort by this field, newest first.

      - `direction: Literal["OUTBOUND"]`

        Always `OUTBOUND`.

        - `"OUTBOUND"`

      - `enrollment_id: str`

        ID of the enrollment the message belongs to.

      - `opened_at: Optional[str]`

        When the email was opened; null until then.

      - `read_at: Optional[str]`

        When the LinkedIn message was read; null until then.

      - `reference: Optional[DataOutboundMessageReference]`

        The email or LinkedIn message record behind this sequence message, readable with <u>[Retrieve an email](/api/resources/email/methods/retrieve)</u> or <u>[Retrieve a message](/api/resources/message/methods/retrieve)</u> under their own scopes; null when there is none.

        - `class DataOutboundMessageReferenceEmail: …`

          - `id: str`

            ID of the email.

          - `object_type: Literal["email"]`

            Always `email`.

            - `"email"`

        - `class DataOutboundMessageReferenceMessage: …`

          - `id: str`

            ID of the message.

          - `object_type: Literal["message"]`

            Always `message`.

            - `"message"`

      - `replied_at: Optional[str]`

        When the contact replied to this message; null until then.

      - `sent_at: Optional[str]`

        When the message was sent; null until then.

      - `sequence_step_id: str`

        ID of the step that sent the message or, for a reply, the step it replied to.

      - `sequence_step_type: Literal["EMAIL", "LINKEDIN_MESSAGE", "LINKEDIN_INVITE"]`

        Type of that step.

        - `"EMAIL"`

        - `"LINKEDIN_MESSAGE"`

        - `"LINKEDIN_INVITE"`

      - `status: Literal["AWAITING_REVIEW", "SCHEDULED", "QUEUED", 4 more]`

        `AWAITING_REVIEW` is waiting for approval; `SCHEDULED` is composed and waiting for its send time; `QUEUED` is due and waiting on the sender. `SENT`, `SKIPPED`, `FAILED` and `CANCELLED` are final.

        - `"AWAITING_REVIEW"`

        - `"SCHEDULED"`

        - `"QUEUED"`

        - `"SENT"`

        - `"SKIPPED"`

        - `"FAILED"`

        - `"CANCELLED"`

      - `status_changed_at: str`

        When `status` last changed.

    - `class DataReply: …`

      - `id: str`

        Unique identifier of the message.

      - `channel: Literal["EMAIL", "LINKEDIN"]`

        Channel the message went over.

        - `"EMAIL"`

        - `"LINKEDIN"`

      - `contact_id: str`

        ID of the contact.

      - `created_at: str`

        When the message was created, or when a reply was received. Lists sort by this field, newest first.

      - `direction: Literal["INBOUND"]`

        Always `INBOUND`.

        - `"INBOUND"`

      - `enrollment_id: str`

        ID of the enrollment the message belongs to.

      - `received_at: str`

        When the reply was received.

      - `reference: Optional[DataReplyReference]`

        The email or LinkedIn message record behind this sequence message, readable with <u>[Retrieve an email](/api/resources/email/methods/retrieve)</u> or <u>[Retrieve a message](/api/resources/message/methods/retrieve)</u> under their own scopes; null when there is none.

        - `class DataReplyReferenceEmail: …`

          - `id: str`

            ID of the email.

          - `object_type: Literal["email"]`

            Always `email`.

            - `"email"`

        - `class DataReplyReferenceMessage: …`

          - `id: str`

            ID of the message.

          - `object_type: Literal["message"]`

            Always `message`.

            - `"message"`

      - `sequence_step_id: str`

        ID of the step that sent the message or, for a reply, the step it replied to.

      - `sequence_step_type: Literal["EMAIL", "LINKEDIN_MESSAGE", "LINKEDIN_INVITE"]`

        Type of that step.

        - `"EMAIL"`

        - `"LINKEDIN_MESSAGE"`

        - `"LINKEDIN_INVITE"`

  - `object: Literal["list"]`

    - `"list"`

  - `total_count: int`

### Sequence List Response

- `class SequenceListResponse: …`

  - `data: List[Data]`

    - `id: str`

      Unique identifier of the sequence.

    - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

      Channels the published steps send on; empty before the first publish.

      - `"EMAIL"`

      - `"LINKEDIN"`

    - `created_at: str`

      ISO 8601 creation timestamp.

    - `definition: Optional[DataDefinition]`

      Published configuration, or null before the first publish.

      - `description: str`

        What this version of the sequence is for.

      - `messaging: DataDefinitionMessaging`

        Messaging inputs that frame every step.

        - `call_to_action: Optional[str]`

          What the recipient is asked to do.

        - `persona: Optional[str]`

          Who the sequence targets.

        - `trigger: Optional[str]`

          Why the outreach is timely.

        - `value_prop: Optional[str]`

          The value proposition.

      - `pacing: DataDefinitionPacing`

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

        - `email: DataDefinitionPacingEmail`

          Email steps.

          - `daily_limit: Optional[int]`

            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.

        - `linkedin_invite: DataDefinitionPacingLinkedinInvite`

          LinkedIn connection requests.

          - `daily_limit: Optional[int]`

            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.

        - `linkedin_message: DataDefinitionPacingLinkedinMessage`

          LinkedIn messages.

          - `daily_limit: Optional[int]`

            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.

      - `priority: Literal["HIGH", "NORMAL"]`

        Send priority relative to other sequences.

        - `"HIGH"`

        - `"NORMAL"`

      - `send_window: DataDefinitionSendWindow`

        When the sequence may send.

        - `days_of_week: List[int]`

          Days sends may go out, 0 = Sunday.

        - `end_hour: int`

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

        - `start_hour: int`

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

        - `timezone: str`

          IANA timezone of the window.

      - `steps: List[DataDefinitionStep]`

        Email, LinkedIn and wait steps in execution order.

        - `class DataDefinitionStepUnionMember0: …`

          - `id: str`

            Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

          - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

            - `"AUTO"`

            - `"FOR_REVIEW"`

          - `mode: Literal["AGENT"]`

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

            - `"AGENT"`

          - `name: str`

            Display name of the step.

          - `prompt: str`

            Instructions the agent follows when composing this message.

          - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

            Step type.

            - `"EMAIL"`

            - `"LINKEDIN_MESSAGE"`

        - `class DataDefinitionStepUnionMember1: …`

          - `id: str`

            Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

          - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

            - `"AUTO"`

            - `"FOR_REVIEW"`

          - `include_note: bool`

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

          - `mode: Literal["AGENT"]`

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

            - `"AGENT"`

          - `name: str`

            Display name of the step.

          - `prompt: str`

            Instructions the agent follows when composing this message.

          - `type: Literal["LINKEDIN_INVITE"]`

            Step type.

            - `"LINKEDIN_INVITE"`

        - `class DataDefinitionStepUnionMember2: …`

          - `id: str`

            Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

          - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

            - `"AUTO"`

            - `"FOR_REVIEW"`

          - `mode: Literal["TEMPLATE"]`

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

            - `"TEMPLATE"`

          - `name: str`

            Display name of the step.

          - `template: DataDefinitionStepUnionMember2Template`

            The email every contact receives.

            - `body: str`

              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: str`

              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: Literal["EMAIL"]`

            Step type.

            - `"EMAIL"`

        - `class DataDefinitionStepUnionMember3: …`

          - `id: str`

            Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

          - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

            - `"AUTO"`

            - `"FOR_REVIEW"`

          - `mode: Literal["TEMPLATE"]`

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

            - `"TEMPLATE"`

          - `name: str`

            Display name of the step.

          - `template: DataDefinitionStepUnionMember3Template`

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

            - `body: str`

              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: Literal["LINKEDIN_MESSAGE"]`

            Step type.

            - `"LINKEDIN_MESSAGE"`

        - `class DataDefinitionStepUnionMember4: …`

          - `id: str`

            Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

          - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

            - `"AUTO"`

            - `"FOR_REVIEW"`

          - `include_note: bool`

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

          - `mode: Literal["TEMPLATE"]`

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

            - `"TEMPLATE"`

          - `name: str`

            Display name of the step.

          - `template: DataDefinitionStepUnionMember4Template`

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

            - `body: str`

              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: Literal["LINKEDIN_INVITE"]`

            Step type.

            - `"LINKEDIN_INVITE"`

        - `class DataDefinitionStepUnionMember5: …`

          - `id: str`

            Step identifier.

          - `duration: int`

            Length of the wait.

          - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

            - `"WAIT"`

            - `"WAIT_FOR_CONNECTION"`

          - `unit: Literal["DAY", "MINUTE"]`

            Unit of `duration`.

            - `"DAY"`

            - `"MINUTE"`

    - `first_activated_at: Optional[str]`

      When the sequence was first activated.

    - `last_activated_at: Optional[str]`

      When the sequence was most recently activated.

    - `name: str`

      Name of the sequence.

    - `object_type: Literal["sequence"]`

      Always `sequence`.

      - `"sequence"`

    - `reviewers: List[DataReviewer]`

      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: str`

        ID of the member.

      - `object_type: Literal["member"]`

        Always `member`.

        - `"member"`

    - `senders: List[DataSender]`

      The senders this sequence sends from; new contacts rotate across them. An archived sender stays listed but never sends; any change to the list drops it.

      - `id: str`

        ID of the sender.

      - `object_type: Literal["sender"]`

        Always `sender`.

        - `"sender"`

    - `status: Literal["DRAFT", "ACTIVE", "DEACTIVATED"]`

      `DRAFT` has not been published; `ACTIVE` is enabled for sending; `DEACTIVATED` is published but paused.

      - `"DRAFT"`

      - `"ACTIVE"`

      - `"DEACTIVATED"`

  - `object: Literal["list"]`

    - `"list"`

  - `total_count: int`

### Sequence List Template Variables Response

- `class SequenceListTemplateVariablesResponse: …`

  - `data: List[Data]`

    - `field: Optional[DataField]`

      The field the variable reads; null for built-in variables.

      - `id: str`

        The `ad_` id of the field, as the field-definitions endpoints list it.

      - `value_type: Literal["ADDRESS", "CHECKBOX", "CURRENCY", 12 more]`

        Type of the field.

        - `"ADDRESS"`

        - `"CHECKBOX"`

        - `"CURRENCY"`

        - `"DATETIME"`

        - `"EMAIL"`

        - `"FULL_NAME"`

        - `"MARKDOWN"`

        - `"MULTI_SELECT"`

        - `"NUMBER"`

        - `"SINGLE_SELECT"`

        - `"SOCIAL_HANDLE"`

        - `"TELEPHONE"`

        - `"TEXT"`

        - `"URL"`

        - `"HTML"`

    - `group: Literal["contact", "account", "sender"]`

      Whose value the variable prints: the enrolled contact, its first account, or the step’s sender.

      - `"contact"`

      - `"account"`

      - `"sender"`

    - `label: str`

      Name of the variable, as the editor shows it.

    - `ref: str`

      The variable, e.g. `{{ {attr:ad_…} }}`. A variable needs a fallback for contacts missing the value: `{{ {attr:ad_…} }}` is written `{{ coalesce({attr:ad_…}, "fallback") }}`, and one without a fallback is refused when the draft is saved.

  - `object: Literal["list"]`

    - `"list"`

  - `total_count: int`

### Sequence Publish Draft Response

- `class SequencePublishDraftResponse: …`

  - `id: str`

    Unique identifier of the sequence.

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the published steps send on; empty before the first publish.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `created_at: str`

    ISO 8601 creation timestamp.

  - `definition: Optional[Definition]`

    Published configuration, or null before the first publish.

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `first_activated_at: Optional[str]`

    When the sequence was first activated.

  - `last_activated_at: Optional[str]`

    When the sequence was most recently activated.

  - `name: str`

    Name of the sequence.

  - `object_type: Literal["sequence"]`

    Always `sequence`.

    - `"sequence"`

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    The senders this sequence sends from; new contacts rotate across them. An archived sender stays listed but never sends; any change to the list drops it.

    - `id: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `status: Literal["DRAFT", "ACTIVE", "DEACTIVATED"]`

    `DRAFT` has not been published; `ACTIVE` is enabled for sending; `DEACTIVATED` is published but paused.

    - `"DRAFT"`

    - `"ACTIVE"`

    - `"DEACTIVATED"`

### Sequence Retrieve Draft Response

- `class SequenceRetrieveDraftResponse: …`

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the draft's steps send on.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `definition: Definition`

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

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `name: str`

    Name the sequence takes when the draft is published.

  - `publish_warnings: List[PublishWarning]`

    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: Literal["delay_shortened", "delay_lengthened", "connection_wait_shortened", 18 more]`

      What publishing would change.

      - `"delay_shortened"`

      - `"delay_lengthened"`

      - `"connection_wait_shortened"`

      - `"connection_wait_lengthened"`

      - `"send_schedule_changed"`

      - `"send_configuration_changed"`

      - `"send_priority_changed"`

      - `"senders_changed"`

      - `"email_sender_pool_emptied"`

      - `"linkedin_account_pool_emptied"`

      - `"assigned_sender_removed"`

      - `"delivery_became_automatic"`

      - `"invite_note_enabled"`

      - `"invite_note_disabled"`

      - `"step_inserted"`

      - `"automatic_send_step_inserted"`

      - `"step_removed"`

      - `"step_type_changed"`

      - `"step_order_changed"`

      - `"full_identity_rewrite"`

      - `"low_identity_overlap"`

    - `message: str`

      What would change, in plain language.

    - `severity: Literal["warning", "destructive"]`

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

      - `"warning"`

      - `"destructive"`

    - `step_ids: List[str]`

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

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    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: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `sequence_id: str`

    The sequence this draft belongs to.

  - `updated_at: str`

    When the draft last changed.

  - `version: str`

    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.

### Sequence Retrieve Enrollment Response

- `class SequenceRetrieveEnrollmentResponse: …`

  - `id: str`

    Unique identifier of the enrollment.

  - `cancelled_at: Optional[str]`

    When the enrollment was cancelled, or null if it was not.

  - `completed_at: Optional[str]`

    When the enrollment completed, or null if it has not.

  - `contact_id: str`

    ID of the enrolled contact.

  - `current_step_id: Optional[str]`

    ID of the step the contact is on, matching `definition.steps`; null when the contact has no current step the API returns.

  - `enrolled_at: str`

    When the contact was enrolled.

  - `enrolled_by: Optional[str]`

    Member ID of whoever enrolled the contact; null when they are no longer a member or the enrollment was automatic.

  - `last_activity_at: Optional[str]`

    When `lastActivityKind` happened; null when there has been no activity.

  - `last_activity_kind: Optional[Literal["SENT", "OPENED", "REPLIED", 4 more]]`

    The latest activity on the enrollment. A reply or bounce that ended the enrollment is reported over a later open.

    - `"SENT"`

    - `"OPENED"`

    - `"REPLIED"`

    - `"BOUNCED"`

    - `"INVITED"`

    - `"CONNECTED"`

    - `"SEEN"`

  - `next_send_at: Optional[str]`

    Estimated time of the next send, from the cadence, send window, pacing and sender; queue order and random gaps can push it later. Null while a message awaits review or is sending, while paused, or when it cannot be estimated.

  - `remaining_sends: Optional[int]`

    Email and LinkedIn steps not yet sent, connection requests included.

  - `replied_at: Optional[str]`

    When the contact first replied, on email or LinkedIn; null if they have not.

  - `status: Optional[Literal["ACTIVE", "AWAITING_REVIEW", "NEEDS_ATTENTION", 5 more]]`

    `ACTIVE` is progressing; `AWAITING_REVIEW` has a message waiting for approval; `NEEDS_ATTENTION` is held by a failed step, a held draft or an unavailable sender; `PAUSED` is stopped because the sequence is deactivated or it was paused in Lightfield. `REPLIED`, `COMPLETED`, `CANCELLED` and `FAILED` are final.

    - `"ACTIVE"`

    - `"AWAITING_REVIEW"`

    - `"NEEDS_ATTENTION"`

    - `"REPLIED"`

    - `"COMPLETED"`

    - `"PAUSED"`

    - `"CANCELLED"`

    - `"FAILED"`

### Sequence Retrieve Message Response

- `SequenceRetrieveMessageResponse`

  - `class OutboundMessage: …`

    - `id: str`

      Unique identifier of the message.

    - `accepted_at: Optional[str]`

      When the connection request was accepted; null until then.

    - `bounced_at: Optional[str]`

      When the email bounced; null until then.

    - `channel: Literal["EMAIL", "LINKEDIN"]`

      Channel the message went over.

      - `"EMAIL"`

      - `"LINKEDIN"`

    - `contact_id: str`

      ID of the contact.

    - `content: Optional[OutboundMessageContent]`

      Plain-text content of the message. Null when the underlying record is no longer available; not included in list responses.

      - `body: Optional[str]`

        Plain-text body; null for a connection request sent without a note.

      - `subject: Optional[str]`

        Email subject; null for LinkedIn.

    - `created_at: str`

      When the message was created, or when a reply was received. Lists sort by this field, newest first.

    - `direction: Literal["OUTBOUND"]`

      Always `OUTBOUND`.

      - `"OUTBOUND"`

    - `enrollment_id: str`

      ID of the enrollment the message belongs to.

    - `opened_at: Optional[str]`

      When the email was opened; null until then.

    - `read_at: Optional[str]`

      When the LinkedIn message was read; null until then.

    - `reference: Optional[OutboundMessageReference]`

      The email or LinkedIn message record behind this sequence message, readable with <u>[Retrieve an email](/api/resources/email/methods/retrieve)</u> or <u>[Retrieve a message](/api/resources/message/methods/retrieve)</u> under their own scopes; null when there is none.

      - `class OutboundMessageReferenceEmail: …`

        - `id: str`

          ID of the email.

        - `object_type: Literal["email"]`

          Always `email`.

          - `"email"`

      - `class OutboundMessageReferenceMessage: …`

        - `id: str`

          ID of the message.

        - `object_type: Literal["message"]`

          Always `message`.

          - `"message"`

    - `replied_at: Optional[str]`

      When the contact replied to this message; null until then.

    - `sent_at: Optional[str]`

      When the message was sent; null until then.

    - `sequence_step_id: str`

      ID of the step that sent the message or, for a reply, the step it replied to.

    - `sequence_step_type: Literal["EMAIL", "LINKEDIN_MESSAGE", "LINKEDIN_INVITE"]`

      Type of that step.

      - `"EMAIL"`

      - `"LINKEDIN_MESSAGE"`

      - `"LINKEDIN_INVITE"`

    - `status: Literal["AWAITING_REVIEW", "SCHEDULED", "QUEUED", 4 more]`

      `AWAITING_REVIEW` is waiting for approval; `SCHEDULED` is composed and waiting for its send time; `QUEUED` is due and waiting on the sender. `SENT`, `SKIPPED`, `FAILED` and `CANCELLED` are final.

      - `"AWAITING_REVIEW"`

      - `"SCHEDULED"`

      - `"QUEUED"`

      - `"SENT"`

      - `"SKIPPED"`

      - `"FAILED"`

      - `"CANCELLED"`

    - `status_changed_at: str`

      When `status` last changed.

  - `class Reply: …`

    - `id: str`

      Unique identifier of the message.

    - `channel: Literal["EMAIL", "LINKEDIN"]`

      Channel the message went over.

      - `"EMAIL"`

      - `"LINKEDIN"`

    - `contact_id: str`

      ID of the contact.

    - `content: Optional[ReplyContent]`

      Plain-text content of the message. Null when the underlying record is no longer available; not included in list responses.

      - `body: Optional[str]`

        Plain-text body; null for a connection request sent without a note.

      - `subject: Optional[str]`

        Email subject; null for LinkedIn.

    - `created_at: str`

      When the message was created, or when a reply was received. Lists sort by this field, newest first.

    - `direction: Literal["INBOUND"]`

      Always `INBOUND`.

      - `"INBOUND"`

    - `enrollment_id: str`

      ID of the enrollment the message belongs to.

    - `received_at: str`

      When the reply was received.

    - `reference: Optional[ReplyReference]`

      The email or LinkedIn message record behind this sequence message, readable with <u>[Retrieve an email](/api/resources/email/methods/retrieve)</u> or <u>[Retrieve a message](/api/resources/message/methods/retrieve)</u> under their own scopes; null when there is none.

      - `class ReplyReferenceEmail: …`

        - `id: str`

          ID of the email.

        - `object_type: Literal["email"]`

          Always `email`.

          - `"email"`

      - `class ReplyReferenceMessage: …`

        - `id: str`

          ID of the message.

        - `object_type: Literal["message"]`

          Always `message`.

          - `"message"`

    - `sequence_step_id: str`

      ID of the step that sent the message or, for a reply, the step it replied to.

    - `sequence_step_type: Literal["EMAIL", "LINKEDIN_MESSAGE", "LINKEDIN_INVITE"]`

      Type of that step.

      - `"EMAIL"`

      - `"LINKEDIN_MESSAGE"`

      - `"LINKEDIN_INVITE"`

### Sequence Retrieve Performance Response

- `class SequenceRetrievePerformanceResponse: …`

  - `by_step_type: ByStepType`

    Lifetime totals for each step type, across all of its steps.

    - `email: ByStepTypeEmail`

      Email steps.

      - `bounced: int`

        Sent emails that bounced.

      - `bounce_rate: Optional[float]`

        Bounced divided by sent; null if none sent.

      - `current_enrollments: int`

        Enrollments currently on steps of this type, paused ones included.

      - `delivered: int`

        Sent minus bounced, never below zero.

      - `opened: int`

        Sent emails that were opened.

      - `open_rate: Optional[float]`

        Opened divided by delivered; null if none delivered.

      - `replied: int`

        Sent messages that received a reply.

      - `reply_rate: Optional[float]`

        Replied divided by delivered; null if none delivered.

      - `sent: int`

        Messages sent.

    - `linkedin_invite: ByStepTypeLinkedinInvite`

      LinkedIn connection request steps.

      - `acceptance_rate: Optional[float]`

        Accepted divided by sent; null if none sent.

      - `accepted: int`

        Connection requests that were accepted.

      - `current_enrollments: int`

        Enrollments currently on steps of this type, paused ones included.

      - `replied: int`

        Sent messages that received a reply.

      - `reply_rate: Optional[float]`

        Replied divided by sent; null if none sent.

      - `sent: int`

        Messages sent.

    - `linkedin_message: ByStepTypeLinkedinMessage`

      LinkedIn message steps.

      - `current_enrollments: int`

        Enrollments currently on steps of this type, paused ones included.

      - `read: int`

        Sent messages that were read.

      - `read_rate: Optional[float]`

        Read divided by sent; null if none sent.

      - `replied: int`

        Sent messages that received a reply.

      - `reply_rate: Optional[float]`

        Replied divided by sent; null if none sent.

      - `sent: int`

        Messages sent.

    - `wait: ByStepTypeWait`

      Wait steps.

      - `current_enrollments: int`

        Enrollments currently on steps of this type, paused ones included.

    - `wait_for_connection: ByStepTypeWaitForConnection`

      Wait-for-connection steps.

      - `current_enrollments: int`

        Enrollments currently on steps of this type, paused ones included.

  - `per_step: List[PerStep]`

    Per-step statistics in published sequence order, including steps with no activity. Steps no longer in the published definition are included if they have sent messages.

    - `class PerStepEmailStep: …`

      - `bounced: int`

        Sent emails that bounced.

      - `bounce_rate: Optional[float]`

        Bounced divided by sent; null if none sent.

      - `current_enrollments: int`

        Enrollments currently on this step, paused ones included.

      - `delivered: int`

        Sent minus bounced, never below zero.

      - `opened: int`

        Sent emails that were opened.

      - `open_rate: Optional[float]`

        Opened divided by delivered; null if none delivered.

      - `replied: int`

        Sent messages that received a reply.

      - `reply_rate: Optional[float]`

        Replied divided by delivered; null if none delivered.

      - `sent: int`

        Messages sent.

      - `sequence_step_id: str`

        ID of the step. A step no longer in the published definition keeps its original ID.

      - `sequence_step_type: Literal["EMAIL"]`

        - `"EMAIL"`

    - `class PerStepLinkedInMessageStep: …`

      - `current_enrollments: int`

        Enrollments currently on this step, paused ones included.

      - `read: int`

        Sent messages that were read.

      - `read_rate: Optional[float]`

        Read divided by sent; null if none sent.

      - `replied: int`

        Sent messages that received a reply.

      - `reply_rate: Optional[float]`

        Replied divided by sent; null if none sent.

      - `sent: int`

        Messages sent.

      - `sequence_step_id: str`

        ID of the step. A step no longer in the published definition keeps its original ID.

      - `sequence_step_type: Literal["LINKEDIN_MESSAGE"]`

        - `"LINKEDIN_MESSAGE"`

    - `class PerStepLinkedInInviteStep: …`

      - `acceptance_rate: Optional[float]`

        Accepted divided by sent; null if none sent.

      - `accepted: int`

        Connection requests that were accepted.

      - `current_enrollments: int`

        Enrollments currently on this step, paused ones included.

      - `replied: int`

        Sent messages that received a reply.

      - `reply_rate: Optional[float]`

        Replied divided by sent; null if none sent.

      - `sent: int`

        Messages sent.

      - `sequence_step_id: str`

        ID of the step. A step no longer in the published definition keeps its original ID.

      - `sequence_step_type: Literal["LINKEDIN_INVITE"]`

        - `"LINKEDIN_INVITE"`

    - `class PerStepWaitStep: …`

      - `current_enrollments: int`

        Enrollments currently on this step, paused ones included.

      - `sequence_step_id: str`

        ID of the step. A step no longer in the published definition keeps its original ID.

      - `sequence_step_type: Literal["WAIT"]`

        - `"WAIT"`

    - `class PerStepWaitForConnectionStep: …`

      - `current_enrollments: int`

        Enrollments currently on this step, paused ones included.

      - `sequence_step_id: str`

        ID of the step. A step no longer in the published definition keeps its original ID.

      - `sequence_step_type: Literal["WAIT_FOR_CONNECTION"]`

        - `"WAIT_FOR_CONNECTION"`

### Sequence Retrieve Response

- `class SequenceRetrieveResponse: …`

  - `id: str`

    Unique identifier of the sequence.

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the published steps send on; empty before the first publish.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `created_at: str`

    ISO 8601 creation timestamp.

  - `definition: Optional[Definition]`

    Published configuration, or null before the first publish.

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `first_activated_at: Optional[str]`

    When the sequence was first activated.

  - `last_activated_at: Optional[str]`

    When the sequence was most recently activated.

  - `name: str`

    Name of the sequence.

  - `object_type: Literal["sequence"]`

    Always `sequence`.

    - `"sequence"`

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    The senders this sequence sends from; new contacts rotate across them. An archived sender stays listed but never sends; any change to the list drops it.

    - `id: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `status: Literal["DRAFT", "ACTIVE", "DEACTIVATED"]`

    `DRAFT` has not been published; `ACTIVE` is enabled for sending; `DEACTIVATED` is published but paused.

    - `"DRAFT"`

    - `"ACTIVE"`

    - `"DEACTIVATED"`

### Sequence Retrieve Test Response

- `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.

    - `"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.

        - `"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.

      - `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.

      - `"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`.

      - `"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.

      - `"EMAIL"`

      - `"LINKEDIN_MESSAGE"`

      - `"LINKEDIN_INVITE"`

      - `"WAIT"`

      - `"WAIT_FOR_CONNECTION"`

  - `target: Literal["DRAFT", "PUBLISHED"]`

    Which version was tested.

    - `"DRAFT"`

    - `"PUBLISHED"`

### Sequence Start Test Response

- `class SequenceStartTestResponse: …`

  - `id: str`

    ID of the test, an enrollment ID. Use it to read the result.

  - `contact_id: str`

    ID of the contact being tested.

  - `status: Literal["RUNNING"]`

    Always `RUNNING`: the test continues after the response.

    - `"RUNNING"`

  - `target: Literal["DRAFT", "PUBLISHED"]`

    Which version is being tested: the open `DRAFT` when there is one or the sequence was never published, otherwise the `PUBLISHED` version.

    - `"DRAFT"`

    - `"PUBLISHED"`

### Sequence Update Draft Response

- `class SequenceUpdateDraftResponse: …`

  - `channels: List[Literal["EMAIL", "LINKEDIN"]]`

    Channels the draft's steps send on.

    - `"EMAIL"`

    - `"LINKEDIN"`

  - `definition: Definition`

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

    - `description: str`

      What this version of the sequence is for.

    - `messaging: DefinitionMessaging`

      Messaging inputs that frame every step.

      - `call_to_action: Optional[str]`

        What the recipient is asked to do.

      - `persona: Optional[str]`

        Who the sequence targets.

      - `trigger: Optional[str]`

        Why the outreach is timely.

      - `value_prop: Optional[str]`

        The value proposition.

    - `pacing: DefinitionPacing`

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

      - `email: DefinitionPacingEmail`

        Email steps.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_invite: DefinitionPacingLinkedinInvite`

        LinkedIn connection requests.

        - `daily_limit: Optional[int]`

          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.

      - `linkedin_message: DefinitionPacingLinkedinMessage`

        LinkedIn messages.

        - `daily_limit: Optional[int]`

          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.

    - `priority: Literal["HIGH", "NORMAL"]`

      Send priority relative to other sequences.

      - `"HIGH"`

      - `"NORMAL"`

    - `send_window: DefinitionSendWindow`

      When the sequence may send.

      - `days_of_week: List[int]`

        Days sends may go out, 0 = Sunday.

      - `end_hour: int`

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

      - `start_hour: int`

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

      - `timezone: str`

        IANA timezone of the window.

    - `steps: List[DefinitionStep]`

      Email, LinkedIn and wait steps in execution order.

      - `class DefinitionStepUnionMember0: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["EMAIL", "LINKEDIN_MESSAGE"]`

          Step type.

          - `"EMAIL"`

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember1: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["AGENT"]`

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

          - `"AGENT"`

        - `name: str`

          Display name of the step.

        - `prompt: str`

          Instructions the agent follows when composing this message.

        - `type: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember2: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember2Template`

          The email every contact receives.

          - `body: str`

            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: str`

            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: Literal["EMAIL"]`

          Step type.

          - `"EMAIL"`

      - `class DefinitionStepUnionMember3: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember3Template`

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

          - `body: str`

            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: Literal["LINKEDIN_MESSAGE"]`

          Step type.

          - `"LINKEDIN_MESSAGE"`

      - `class DefinitionStepUnionMember4: …`

        - `id: str`

          Step identifier, referenced by enrollment `currentStepId` and message `sequenceStepId`.

        - `delivery_mode: Literal["AUTO", "FOR_REVIEW"]`

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

          - `"AUTO"`

          - `"FOR_REVIEW"`

        - `include_note: bool`

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

        - `mode: Literal["TEMPLATE"]`

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

          - `"TEMPLATE"`

        - `name: str`

          Display name of the step.

        - `template: DefinitionStepUnionMember4Template`

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

          - `body: str`

            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: Literal["LINKEDIN_INVITE"]`

          Step type.

          - `"LINKEDIN_INVITE"`

      - `class DefinitionStepUnionMember5: …`

        - `id: str`

          Step identifier.

        - `duration: int`

          Length of the wait.

        - `type: Literal["WAIT", "WAIT_FOR_CONNECTION"]`

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

          - `"WAIT"`

          - `"WAIT_FOR_CONNECTION"`

        - `unit: Literal["DAY", "MINUTE"]`

          Unit of `duration`.

          - `"DAY"`

          - `"MINUTE"`

  - `name: str`

    Name the sequence takes when the draft is published.

  - `publish_warnings: List[PublishWarning]`

    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: Literal["delay_shortened", "delay_lengthened", "connection_wait_shortened", 18 more]`

      What publishing would change.

      - `"delay_shortened"`

      - `"delay_lengthened"`

      - `"connection_wait_shortened"`

      - `"connection_wait_lengthened"`

      - `"send_schedule_changed"`

      - `"send_configuration_changed"`

      - `"send_priority_changed"`

      - `"senders_changed"`

      - `"email_sender_pool_emptied"`

      - `"linkedin_account_pool_emptied"`

      - `"assigned_sender_removed"`

      - `"delivery_became_automatic"`

      - `"invite_note_enabled"`

      - `"invite_note_disabled"`

      - `"step_inserted"`

      - `"automatic_send_step_inserted"`

      - `"step_removed"`

      - `"step_type_changed"`

      - `"step_order_changed"`

      - `"full_identity_rewrite"`

      - `"low_identity_overlap"`

    - `message: str`

      What would change, in plain language.

    - `severity: Literal["warning", "destructive"]`

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

      - `"warning"`

      - `"destructive"`

    - `step_ids: List[str]`

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

  - `reviewers: List[Reviewer]`

    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: str`

      ID of the member.

    - `object_type: Literal["member"]`

      Always `member`.

      - `"member"`

  - `senders: List[Sender]`

    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: str`

      ID of the sender.

    - `object_type: Literal["sender"]`

      Always `sender`.

      - `"sender"`

  - `sequence_id: str`

    The sequence this draft belongs to.

  - `updated_at: str`

    When the draft last changed.

  - `version: str`

    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.

### Sequence Update Enrollments Response

- `class SequenceUpdateEnrollmentsResponse: …`

  - `results: List[Result]`

    One result per distinct contact, additions first, then removals.

    - `class ResultEnrollmentChanged: …`

      - `contact_id: str`

        ID of the contact.

      - `enrollment_id: str`

        ID of the enrollment the outcome applies to.

      - `outcome: Literal["enrolled", "already_enrolled", "unenrolled"]`

        `enrolled` created the enrollment, `already_enrolled` left an open one as is, `unenrolled` cancelled it.

        - `"enrolled"`

        - `"already_enrolled"`

        - `"unenrolled"`

    - `class ResultNothingToCancel: …`

      - `contact_id: str`

        ID of the contact.

      - `enrollment_id: None`

        Always null.

      - `outcome: Literal["no_active_enrollment"]`

        The contact had no open enrollment to cancel.

        - `"no_active_enrollment"`
