## 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
}
```
