> ## 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 sequences and their steps for a specific campaign.

# Get Campaign Sequences

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="Sequence" objectPath="sequence" />

For example, if the main sequence includes a condition that contains two sequences, you will receive both the sequence tree and all condition sequences in the main sequences array.


## OpenAPI

````yaml get /campaigns/{campaignId}/sequences
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:
  /campaigns/{campaignId}/sequences:
    parameters:
      - name: campaignId
        in: path
        required: true
        description: The unique identifier of the campaign
        example: cam_A1B2C3D4E5F6G7H8I9
        schema:
          type: string
    get:
      tags:
        - Sequences
      summary: Get Campaign Sequences
      parameters: []
      responses:
        '200':
          headers:
            Content-Type:
              schema:
                type: string
              example: application/json
          description: Success
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Object where each key is a sequence ID and each value is a
                  sequence object
                additionalProperties:
                  type: object
                  properties:
                    _id:
                      type: string
                      description: The unique identifier of the sequence
                    steps:
                      type: array
                      description: Array of steps in the sequence
                      items:
                        type: object
                        properties:
                          _id:
                            type: string
                            description: The unique identifier of the step
                          delay:
                            type: integer
                            description: The delay in days before executing this step
                          emailTemplateId:
                            type: string
                            description: >-
                              The unique identifier of the email template used
                              for this step
                          type:
                            type: string
                            description: >-
                              The type of step (e.g., email, linkedinSend,
                              linkedinInvite, conditional)
                          index:
                            type: integer
                            description: The position of the step in the sequence
                          sequenceId:
                            type: string
                            description: The unique identifier of the parent sequence
                          sequenceStep:
                            type: integer
                            description: The step number in the sequence
                          message:
                            type: string
                            description: >-
                              The message content for the step (plain text for
                              LinkedIn, HTML for email)
                          subject:
                            type: string
                            description: The email subject line (only for email steps)
                    level:
                      type: integer
                      description: >-
                        The nesting level of the sequence (0 for main sequence,
                        1+ for nested conditional sequences)
                    parentId:
                      type: string
                      description: >-
                        The unique identifier of the parent sequence (only for
                        conditional sequences)
                    conditionalStepIndex:
                      type: integer
                      description: >-
                        The index of the conditional step that triggers this
                        sequence (only for conditional sequences)
              example:
                seq_rH5RD3fMkkt2gM3YC:
                  _id: seq_rH5RD3fMkkt2gM3YC
                  steps:
                    - _id: stp_sFUj6keaSz9wr049M
                      delay: 0
                      emailTemplateId: etp_ahlbc2yafFyu728H8
                      type: linkedinSend
                      index: 1
                      sequenceId: seq_rH5RD3fMkkt2gM3YC
                      sequenceStep: 0
                      message: >-
                        Hey {{firstName}}, 


                        we're launching an event, a place where people can
                        regularly meet, network, and learn from each other. We
                        would love it if you could join us for a drink & chat
                        next week. What do you say? 😊
                    - _id: stp_qsTl0LO6zkQQJQqsP
                      delay: 1
                      emailTemplateId: etp_HFjUGtyDxIOxgZYcG
                      index: 2
                      sequenceId: seq_rH5RD3fMkkt2gM3YC
                      sequenceStep: 1
                      subject: '{{firstName}}, do we count on you for the event?'
                      message: >-
                        <p style="margin: 0px; box-sizing: border-box;">Hey
                        {{firstName}},<br style="box-sizing: border-box;"><br
                        style="box-sizing: border-box;"></p>

                        <p style="margin: 0px; box-sizing: border-box;">Do you
                        have any plans for Thursday, 7pm?<br style="box-sizing:
                        border-box;"><br style="box-sizing: border-box;"></p>

                        <p style="margin: 0px; box-sizing: border-box;">What
                        about spending the evening with cool people by our
                        office?<br style="box-sizing: border-box;"><br
                        style="box-sizing: border-box;"></p>

                        <p style="margin: 0px; box-sizing: border-box;">We're
                        launching an event, a place where people can regularly
                        meet, network, and build connections that help them grow
                        further 😊<br style="box-sizing: border-box;"><br
                        style="box-sizing: border-box;"></p>

                        <p style="margin: 0px; box-sizing: border-box;">It would
                        be really nice if we could count on you for the
                        event-&nbsp;<a target="_blank" style="color: rgb(0, 123,
                        255); text-decoration: none; background-color:
                        transparent; user-select: auto; box-sizing: border-box;"
                        rel="noopener noreferrer"
                        href="{{event_link_to_send}}">here's your
                        invite</a>&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;">Can you
                        make it?<br style="box-sizing: border-box;"><br
                        style="box-sizing: border-box;"></p>

                        <p style="margin: 0px; box-sizing:
                        border-box;">Sarah,</p><p style="margin: 0px;
                        box-sizing: border-box;">Head of Marketing</p>
                      type: email
                    - _id: stp_pRcXzJDmOrBkFtNc3
                      delay: 1
                      emailTemplateId: etp_3tjFTgdOMS6JL8U1g
                      index: 3
                      sequenceId: seq_rH5RD3fMkkt2gM3YC
                      sequenceStep: 2
                      subject: '{{firstName}}, do we count on you for the event?'
                      message: >-
                        <p style="margin: 0px; box-sizing: border-box;">So,
                        should I add you to the list of attendees?<br
                        style="box-sizing: border-box;"><br style="box-sizing:
                        border-box;"></p>

                        <p style="margin: 0px; box-sizing: border-box;">We'll
                        meet around 7pm, have a drink and exchange with
                        entrepreneurs, marketers, and salespeople.<br
                        style="box-sizing: border-box;"><br style="box-sizing:
                        border-box;"></p>

                        <p style="margin: 0px; box-sizing: border-box;"><a
                        target="_blank" style="color: rgb(0, 123, 255);
                        text-decoration: none; background-color: transparent;
                        user-select: auto; box-sizing: border-box;"
                        rel="noopener noreferrer"
                        href="{{event_link_to_send}}">Here's the link</a> if you
                        want to join!<br style="box-sizing: border-box;"><br
                        style="box-sizing: border-box;"></p>

                        <p style="margin: 0px; box-sizing: border-box;">We would
                        love to have you with us for this event!<br
                        style="box-sizing: border-box;"><br style="box-sizing:
                        border-box;">Sarah</p><p style="margin: 0px; box-sizing:
                        border-box;">Head of Marketing</p>
                      type: email
                  level: 0
        '400':
          description: 'Possible errors: Bad team / Campaign has no sequence'
          content:
            text/plain:
              example: Bad team
        '401':
          description: The authentication you supplied is incorrect
          content:
            text/plain:
              example: The authentication you supplied is incorrect
        '404':
          description: Campaign not found
          content:
            text/plain:
              example: Campaign not found
        '405':
          description: Method not allowed
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````