## Retrieve a sequence message

`client.Sequence.GetMessage(ctx, messageID, query) (*SequenceRetrieveMessageResponseUnion, error)`

**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

- `messageID string`

  Unique identifier of the message to retrieve.

- `query SequenceGetMessageParams`

  - `ID param.Field[string]`

    Unique identifier of the sequence.

### Returns

- `type SequenceRetrieveMessageResponseUnion interface{…}`

  - `type SequenceRetrieveMessageResponseOutboundMessage struct{…}`

    - `ID string`

      Unique identifier of the message.

    - `AcceptedAt string`

      When the connection request was accepted; null until then.

    - `BouncedAt string`

      When the email bounced; null until then.

    - `Channel string`

      Channel the message went over.

      - `const SequenceRetrieveMessageResponseOutboundMessageChannelEmail SequenceRetrieveMessageResponseOutboundMessageChannel = "EMAIL"`

      - `const SequenceRetrieveMessageResponseOutboundMessageChannelLinkedin SequenceRetrieveMessageResponseOutboundMessageChannel = "LINKEDIN"`

    - `ContactID string`

      ID of the contact.

    - `Content SequenceRetrieveMessageResponseOutboundMessageContent`

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

      - `Body string`

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

      - `Subject string`

        Email subject; null for LinkedIn.

    - `CreatedAt string`

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

    - `Direction string`

      Always `OUTBOUND`.

      - `const SequenceRetrieveMessageResponseOutboundMessageDirectionOutbound SequenceRetrieveMessageResponseOutboundMessageDirection = "OUTBOUND"`

    - `EnrollmentID string`

      ID of the enrollment the message belongs to.

    - `OpenedAt string`

      When the email was opened; null until then.

    - `ReadAt string`

      When the LinkedIn message was read; null until then.

    - `Reference SequenceRetrieveMessageResponseOutboundMessageReferenceUnion`

      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.

      - `type SequenceRetrieveMessageResponseOutboundMessageReferenceEmail struct{…}`

        - `ID string`

          ID of the email.

        - `ObjectType string`

          Always `email`.

          - `const SequenceRetrieveMessageResponseOutboundMessageReferenceEmailObjectTypeEmail SequenceRetrieveMessageResponseOutboundMessageReferenceEmailObjectType = "email"`

      - `type SequenceRetrieveMessageResponseOutboundMessageReferenceMessage struct{…}`

        - `ID string`

          ID of the message.

        - `ObjectType string`

          Always `message`.

          - `const SequenceRetrieveMessageResponseOutboundMessageReferenceMessageObjectTypeMessage SequenceRetrieveMessageResponseOutboundMessageReferenceMessageObjectType = "message"`

    - `RepliedAt string`

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

    - `SentAt string`

      When the message was sent; null until then.

    - `SequenceStepID string`

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

    - `SequenceStepType string`

      Type of that step.

      - `const SequenceRetrieveMessageResponseOutboundMessageSequenceStepTypeEmail SequenceRetrieveMessageResponseOutboundMessageSequenceStepType = "EMAIL"`

      - `const SequenceRetrieveMessageResponseOutboundMessageSequenceStepTypeLinkedinMessage SequenceRetrieveMessageResponseOutboundMessageSequenceStepType = "LINKEDIN_MESSAGE"`

      - `const SequenceRetrieveMessageResponseOutboundMessageSequenceStepTypeLinkedinInvite SequenceRetrieveMessageResponseOutboundMessageSequenceStepType = "LINKEDIN_INVITE"`

    - `Status string`

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

      - `const SequenceRetrieveMessageResponseOutboundMessageStatusAwaitingReview SequenceRetrieveMessageResponseOutboundMessageStatus = "AWAITING_REVIEW"`

      - `const SequenceRetrieveMessageResponseOutboundMessageStatusScheduled SequenceRetrieveMessageResponseOutboundMessageStatus = "SCHEDULED"`

      - `const SequenceRetrieveMessageResponseOutboundMessageStatusQueued SequenceRetrieveMessageResponseOutboundMessageStatus = "QUEUED"`

      - `const SequenceRetrieveMessageResponseOutboundMessageStatusSent SequenceRetrieveMessageResponseOutboundMessageStatus = "SENT"`

      - `const SequenceRetrieveMessageResponseOutboundMessageStatusSkipped SequenceRetrieveMessageResponseOutboundMessageStatus = "SKIPPED"`

      - `const SequenceRetrieveMessageResponseOutboundMessageStatusFailed SequenceRetrieveMessageResponseOutboundMessageStatus = "FAILED"`

      - `const SequenceRetrieveMessageResponseOutboundMessageStatusCancelled SequenceRetrieveMessageResponseOutboundMessageStatus = "CANCELLED"`

    - `StatusChangedAt string`

      When `status` last changed.

  - `type SequenceRetrieveMessageResponseReply struct{…}`

    - `ID string`

      Unique identifier of the message.

    - `Channel string`

      Channel the message went over.

      - `const SequenceRetrieveMessageResponseReplyChannelEmail SequenceRetrieveMessageResponseReplyChannel = "EMAIL"`

      - `const SequenceRetrieveMessageResponseReplyChannelLinkedin SequenceRetrieveMessageResponseReplyChannel = "LINKEDIN"`

    - `ContactID string`

      ID of the contact.

    - `Content SequenceRetrieveMessageResponseReplyContent`

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

      - `Body string`

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

      - `Subject string`

        Email subject; null for LinkedIn.

    - `CreatedAt string`

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

    - `Direction string`

      Always `INBOUND`.

      - `const SequenceRetrieveMessageResponseReplyDirectionInbound SequenceRetrieveMessageResponseReplyDirection = "INBOUND"`

    - `EnrollmentID string`

      ID of the enrollment the message belongs to.

    - `ReceivedAt string`

      When the reply was received.

    - `Reference SequenceRetrieveMessageResponseReplyReferenceUnion`

      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.

      - `type SequenceRetrieveMessageResponseReplyReferenceEmail struct{…}`

        - `ID string`

          ID of the email.

        - `ObjectType string`

          Always `email`.

          - `const SequenceRetrieveMessageResponseReplyReferenceEmailObjectTypeEmail SequenceRetrieveMessageResponseReplyReferenceEmailObjectType = "email"`

      - `type SequenceRetrieveMessageResponseReplyReferenceMessage struct{…}`

        - `ID string`

          ID of the message.

        - `ObjectType string`

          Always `message`.

          - `const SequenceRetrieveMessageResponseReplyReferenceMessageObjectTypeMessage SequenceRetrieveMessageResponseReplyReferenceMessageObjectType = "message"`

    - `SequenceStepID string`

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

    - `SequenceStepType string`

      Type of that step.

      - `const SequenceRetrieveMessageResponseReplySequenceStepTypeEmail SequenceRetrieveMessageResponseReplySequenceStepType = "EMAIL"`

      - `const SequenceRetrieveMessageResponseReplySequenceStepTypeLinkedinMessage SequenceRetrieveMessageResponseReplySequenceStepType = "LINKEDIN_MESSAGE"`

      - `const SequenceRetrieveMessageResponseReplySequenceStepTypeLinkedinInvite SequenceRetrieveMessageResponseReplySequenceStepType = "LINKEDIN_INVITE"`

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := githubcomlightfldlightfieldgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  sequenceRetrieveMessageResponse, err := client.Sequence.GetMessage(
    context.TODO(),
    "messageId",
    githubcomlightfldlightfieldgo.SequenceGetMessageParams{
      ID: "id",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", sequenceRetrieveMessageResponse)
}
```

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