> ## Documentation Index
> Fetch the complete documentation index at: https://developer.lemlist.com/llms.txt
> Use this file to discover all available pages before exploring further.

> Retrieves all messages exchanged with a specific contact.

# Get Contact Messages

export const SnippetObjectReference = ({objectName, objectPath = null}) => {
  const lowerCaseObjectName = objectName.toLowerCase();
  if (lowerCaseObjectName === 'lead' || lowerCaseObjectName === 'leads') {
    return <Note>
        This endpoint uses the <a href={`/api-reference/objects-definitions/${objectPath}`}>{objectName} object</a>. Make sure to also check the <a href={`/api-reference/objects-definitions/${lowerCaseObjectName === 'lead' ? 'contact' : 'lead'}`}>{lowerCaseObjectName === 'lead' ? 'Contact' : 'Lead'} object</a> to understand the distinction between the two.
      </Note>;
  }
  return <Note>
      This endpoint uses the <a href={`/api-reference/objects-definitions/${objectPath}`}>{objectName} object</a>.
    </Note>;
};

<SnippetObjectReference objectName="Inbox/Contact Message" objectPath="inbox-message" />


## OpenAPI

````yaml get /inbox/{contactId}
openapi: 3.0.0
info:
  title: lemlist API
  version: 1.0.0
  description: >-
    Welcome to the lemlist Developer Documentation.


    lemlist is very customizable and open. You'll find on this page all the API
    and integration you can do with lemlist.


    # Rate Limit


    lemlist's API rate limits requests in order to prevent abuse and overload of
    our services.  

    Rate limits are applied on all routes and per API key performing the
    request.  

    The rate limits are **20** requests per **2** seconds.  

    The response provides any information you may need about it:


    | Header | Description |

    | --- | --- |

    | Retry-After | The number of seconds in which you can retry |

    | X-RateLimit-Limit | The maximum requests in that time |

    | X-RateLimit-Remaining | The number of remaining requests you can make |

    | X-RateLimit-Reset | The date when the rate limit will reset |


    _Example of values for the rate limit headers_


    ``` json

    {
        "Retry-After": 2,
        "X-RateLimit-Limit": 20,
        "X-RateLimit-Remaining": 7,
        "X-RateLimit-Reset" : "Tue Feb 16 2021 09:02:42 GMT+0100 (Central European Standard Time)"
    }

     ```

    # Definitions


    ## Team


    A team is the entity of lemlist that can handle users and billing.


    ## Credits


    Credits are the coins a team uses to enrich emails, LinkedIn URLs, etc. via
    the enrich route. Each enrichment feature needs a certain amount of credits
    to run.


    ## User


    You use a user account to connect to lemlist and send messages via the
    connected emails or LinkedIn account.


    ## Campaign


    A campaign is the entity to automate outreach. A campaign has multiple
    sequences composed of steps.


    ## Lead


    A lead is a person that you try to contact via a campaign.


    ## Activity


    An activity is the history of all the steps.


    ## Unsubscribe


    An unsubscribe occurs when a person decides they don't want to receive
    emails from you anymore.


    # Authentication


    All API routes use the dedicated subdomain `api.lemlist.com`.


    lemlist uses API keys to allow access to the API. You can get your lemlist
    API key at our [integration
    page](https://app.lemlist.com/settings/integrations).


    You need to add the `Authorization` header using the `Basic` authentication
    type. `login:password` **where the login is always empty and the password is
    the API key**.


    ⚠️ **Don't forget to add the semicolon (**`:`**) before your API key in curl
    command.**


    > To authorize, use this code: 
      

    ``` shell

    curl https://api.lemlist.com/api/team \
      --user ":YourApiKey"

     ```

    **Make sure to replace** **`YourApiKey`** **with your API key.**


    # Give feedback


    If you want to report a bug, ask for data, or share with us a use case,
    please fill this [form](https://lemlist.typeform.com/to/mfVlkyGf). It will
    help us centralize your needs!
servers:
  - url: https://api.lemlist.com/api
security:
  - basicAuth: []
paths:
  /inbox/{contactId}:
    parameters:
      - name: contactId
        in: path
        required: true
        description: The unique identifier of the contact
        example: ctc_ei6zVayP9B2ugwUPN
        schema:
          type: string
    get:
      tags:
        - Inbox
      summary: Get Contact Messages
      parameters:
        - name: userId
          in: query
          required: false
          description: ID of the user viewing the conversation
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: The maximum number of records to return
          example: '10'
          schema:
            type: integer
        - name: skip
          in: query
          required: false
          description: 'Number of items to skip. Default: 0'
          example: '1'
          schema:
            type: integer
        - name: markAsRead
          in: query
          required: false
          description: 'When true, marks the conversation as read. Default: false'
          example: 'true'
          schema:
            type: boolean
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InboxMessage'
                  pagination:
                    type: object
                    properties:
                      totalItems:
                        type: integer
                      currentPage:
                        type: integer
                      nextPage:
                        type: integer
                        nullable: true
                      previousPage:
                        type: integer
                        nullable: true
                      perPage:
                        type: integer
                      totalPages:
                        type: integer
              example:
                data:
                  - _id: act_vQJUQw4OMGqp25aTi
                    type: emailsSent
                    messageId: >-
                      <CAPLqhUKnWmszLsJxMO3osKL7YgU3-b_5kC+f4SvqYOVfzRc28g@mail.gmail.com>
                    createdAt: '2024-12-05T16:39:41.416Z'
                    teamId: tea_8QvkOiBfPdb2ZRhHi
                    leadId: lea_tmOgcDHB5wWwStNtN
                    campaignId: cam_pijDVnytN5S7frriD
                    sequenceId: seq_KnckIbUtWVFAsdCBG
                    sequenceStep: 0
                    sendUserId: usr_bcPQCObkKptmHw2Rp
                    sendUserName: Alex DOE
                    sendUserEmail: alex.doe@example.com
                    sendUserMailboxId: usm_05P73WrvTqHY8OAee
                    leadEmail: alex@example.com
                    contactId: ctc_Ds0IaxECSACsbLMzA
                    message: >-
                      <html><div style="min-width: 360px"></div><div dir="ltr">
                          <div>Hello lemlist Team! 😎<br style="box-sizing: border-box;"><br style="box-sizing: border-box;">I joined lemlist last Monday, and I am humbly offering you the chance to meet me (and probably my cat, Megatron 😽🤖) through a 15-minute call at your convenience! You can book it <span style="cursor: pointer; background: var(--tertiary2-color-100); color: var(--alert); box-sizing: border-box;" data-error="true">[here]</span>(https://app.lemcal.com/@alex-doe/quick-meeting?leadId=lea_tmOgcDHB5wWwStNtN).<br style="box-sizing: border-box;"><br style="box-sizing: border-box;">See you soon!<br style="box-sizing: border-box;"><br style="box-sizing: border-box;">Alex DOE</div>
                          <div class="gmail_extra">
                            <div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"></div></div></div></div>
                            
                          </div>
                          </div>
                      <span
                      summary="/api/reply/data-ll-tsk_lxY7QI0bYAop5cPBU"></span>

                      <img alt="logo"
                      src="https://zr0.lemlst.org/api/track/open/usr_bcPQCObkKptmHw2Rp/tsk_lxY7QI0bYAop5cPBU"
                      height="1" width="1"></html>
                    subject: Meet me !
                    attachments: []
                  - _id: act_HXQTqg6L29jdy3b6K
                    type: emailsReplied
                    messageId: >-
                      <CAKs+3EYjH0POGz0H-rS1XHH1YnG9LtN2m4y8LocddFWWMm8HBw@mail.gmail.com>
                    createdAt: '2024-12-03T10:10:45.000Z'
                    fromEmail: alex@example.com
                    teamId: tea_8QvkOiBfPdb2ZRhHi
                    leadId: lea_lzfQLRbKAZdKvjCwg
                    campaignId: cam_UBbMt30jHq0vNJKJr
                    sequenceId: seq_ZDRIjDniOznJJLcKO
                    sequenceStep: 0
                    sendUserId: usr_xtJHBMYJSOHzI3ZFb
                    sendUserName: Jordan DOE
                    sendUserEmail: jordan.doe@example.com
                    sendUserMailboxId: usm_CT2BPoHic0I1cmitZ
                    leadEmail: alex@example.com
                    contactId: ctc_Ds0IaxECSACsbLMzA
                    message: >
                      <div dir="ltr">Haha Welcome Jordan, j&#39;adore cette
                      campagne ! <br><br>A très vite, <div>Alex
                      </div></div><br><div class="gmail_quote
                      gmail_quote_container"><div dir="ltr"
                      class="gmail_attr">On Tue, Dec 3, 2024 at 10:52 AM Jordan
                      DOE &lt;<a
                      href="mailto:jordan.doe@example.com">jordan.doe@example.com</a>&gt;
                      wrote:<br></div><blockquote class="gmail_quote"
                      style="margin:0px 0px 0px 0.8ex;border-left:1px solid
                      rgb(204,204,204);padding-left:1ex"><div
                      style="min-width:360px"></div><div dir="ltr">
                          <div><p style="margin:0px;box-sizing:border-box">Hey Alex  , </p><p style="margin:0px;box-sizing:border-box"><br style="box-sizing:border-box"></p><p style="margin:0px;box-sizing:border-box">I hope this email finds you well!</p><p style="margin:0px;box-sizing:border-box"><br style="box-sizing:border-box"></p><p style="margin:0px;box-sizing:border-box">Have you ever heard about Jordan Doe? <br> <br>🇫🇷 He was a member of the French Parliament during the French Revolution, <br>🏘️ He has a street named after him<br><strong style="font-weight:700;box-sizing:border-box">📙 </strong>He authored the famous &quot;Beurre frais épuré, et conservant longtemps ses bonnes qualités, sans devenir rance&quot;.<br style="box-sizing:border-box"><br style="box-sizing:border-box"><img width="134" style="width: 134px; display: block; vertical-align: top; margin: 5px auto; text-align: center; border-style: none; padding: 0px 1px; box-sizing: border-box;" src="https://zr0.lemlst.org/api/files/Files/fil_3WlQwHwsxgZZCRnu3.png"></p><p style="margin:0px;box-sizing:border-box"><br style="box-sizing:border-box"></p><p style="margin:0px;box-sizing:border-box">Unfortunately, this brilliant man died ages ago...</p><p style="margin:0px;box-sizing:border-box"><br style="box-sizing:border-box"></p><p style="margin:0px;box-sizing:border-box">But wait, there&#39;s another Jordan Doe you might be interested in meeting—one who is very much alive and well! Yes, that&#39;s me. I&#39;ve just joined Lemlist, and I&#39;m looking forward to meeting everyone for a quick chat.</p><p style="margin:0px;box-sizing:border-box"><br style="box-sizing:border-box"></p><p style="margin:0px;box-sizing:border-box">☑️ Book an appointment on 📅 <a style="color:rgb(51,138,241);text-decoration:none;background-color:transparent;box-sizing:border-box;font-weight:500" href="https://app.lemcal.com/@jordan-doe/15-min-chat?leadId=lea_lzfQLRbKAZdKvjCwg" target="_blank">my lemcal</a> !</p><p style="margin:0px;box-sizing:border-box"><br></p><p style="margin:0px;box-sizing:border-box">Feel free to reach out and get to know me better. I'm excited to be part of the team and eager to contribute to our collective success.</p><p style="margin:0px;box-sizing:border-box">Looking forward to seeing you all soon!<br style="box-sizing:border-box"><br style="box-sizing:border-box">Best regards, as your contemporary, Jordan Doe</p></div>
                          <div class="gmail_extra">
                            <div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"></div></div></div></div>
                            
                          </div>
                          </div>
                      <span
                      summary="/api/reply/data-ll-tsk_IMjjv5uq8YIsjuDSw"></span>

                      <img alt="logo"
                      src="https://zr0.lemlst.org/api/track/open/usr_xtJHBMYJSOHzI3ZFb/tsk_IMjjv5uq8YIsjuDSw"
                      height="1" width="1">

                      </blockquote></div>
                    subject: 'Re: Have you heard about Jordan Doe ?'
                    attachments: []
                  - _id: act_gKmkJOLCfUl4TkhIl
                    type: emailsSent
                    messageId: >-
                      <CADuPnhJfe0BDrR47w4DNsvQT9kStS3DHQ9B4cP2=8AciE_M42w@mail.gmail.com>
                    createdAt: '2024-12-03T09:52:55.319Z'
                    teamId: tea_8QvkOiBfPdb2ZRhHi
                    leadId: lea_lzfQLRbKAZdKvjCwg
                    campaignId: cam_UBbMt30jHq0vNJKJr
                    sequenceId: seq_ZDRIjDniOznJJLcKO
                    sequenceStep: 0
                    sendUserId: usr_xtJHBMYJSOHzI3ZFb
                    sendUserName: Jordan DOE
                    sendUserEmail: jordan.doe@example.com
                    sendUserMailboxId: usm_CT2BPoHic0I1cmitZ
                    leadEmail: alex@example.com
                    contactId: ctc_Ds0IaxECSACsbLMzA
                    message: >-
                      <html><div style="min-width: 360px"></div><div dir="ltr">
                          <div><p style="margin: 0px; box-sizing: border-box;">Hey Alex  ,&nbsp;</p><p style="margin: 0px; box-sizing: border-box;"><br style="box-sizing: border-box;"></p><p style="margin: 0px; box-sizing: border-box;">I hope this email finds you well!</p><p style="margin: 0px; box-sizing: border-box;"><br style="box-sizing: border-box;"></p><p style="margin: 0px; box-sizing: border-box;">Have you ever heard about Jordan Doe? <br> <br>🇫🇷 He was a member of the French Parliament during the French Revolution, <br>🏘️ He has a street named after him<br><strong style="font-weight: 700; box-sizing: border-box;">📙&nbsp;</strong>He authored the famous "Beurre frais épuré, et conservant longtemps ses bonnes qualités, sans devenir rance".<br style="box-sizing: border-box;"><br style="box-sizing: border-box;"><img  width="134" style="width: 134px; display: block; vertical-align: top; margin: 5px auto; text-align: center; border-style: none; cursor: pointer; padding: 0px 1px; box-sizing: border-box;" src="https://zr0.lemlst.org/api/files/Files/fil_3WlQwHwsxgZZCRnu3.png"></p><p style="margin: 0px; box-sizing: border-box;"><br style="box-sizing: border-box;"></p><p style="margin: 0px; box-sizing: border-box;">Unfortunately, this brilliant man died ages ago...</p><p style="margin: 0px; box-sizing: border-box;"><br style="box-sizing: border-box;"></p><p style="margin: 0px; box-sizing: border-box;">But wait, there's another Jordan Doe you might be interested in meeting—one who is very much alive and well! Yes, that's me. I've just joined Lemlist, and I'm looking forward to meeting everyone for a quick chat.</p><p style="margin: 0px; box-sizing: border-box;"><br style="box-sizing: border-box;"></p><p style="margin: 0px; box-sizing: border-box;">☑️ Book an appointment on 📅 <a style="color: rgb(51, 138, 241); text-decoration: none; background-color: transparent; user-select: auto; box-sizing: border-box; font-weight: 500;" href="https://app.lemcal.com/@jordan-doe/15-min-chat?leadId=lea_lzfQLRbKAZdKvjCwg">my lemcal</a> !</p><p style="margin: 0px; box-sizing: border-box;"><br></p><p style="margin: 0px; box-sizing: border-box;">Feel free to reach out and get to know me better. I'm excited to be part of the team and eager to contribute to our collective success.</p><p style="margin: 0px; box-sizing: border-box;">Looking forward to seeing you all soon!<br style="box-sizing: border-box;"><br style="box-sizing: border-box;">Best regards, as your contemporary, Jordan Doe</p></div>
                          <div class="gmail_extra">
                            <div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"></div></div></div></div>
                            
                          </div>
                          </div>
                      <span
                      summary="/api/reply/data-ll-tsk_IMjjv5uq8YIsjuDSw"></span>

                      <img alt="logo"
                      src="https://zr0.lemlst.org/api/track/open/usr_xtJHBMYJSOHzI3ZFb/tsk_IMjjv5uq8YIsjuDSw"
                      height="1" width="1"></html>
                    subject: Have you heard about Jordan Doe  ?
                    attachments: []
                pagination:
                  totalItems: 3
                  currentPage: 1
                  nextPage: null
                  previousPage: null
                  perPage: 10
                  totalPages: 1
        '400':
          description: >-
            Possible errors: Bad team / Invalid contactId / Invalid userId /
            User not in team / User ID is required to mark as read
          content:
            text/plain:
              example: Bad team
        '401':
          description: The authentication you supplied is incorrect
          content:
            text/plain:
              example: The authentication you supplied is incorrect
        '405':
          description: Method not allowed
components:
  schemas:
    InboxMessage:
      type: object
      description: A single message within an inbox conversation.
      properties:
        _id:
          type: string
        conversationId:
          type: string
        sender:
          type: string
        recipient:
          type: string
        body:
          type: string
        sentAt:
          type: string
          format: date-time
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````