> ## 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 performance statistics for multiple campaigns in a single request.

# Get Batch Campaign Stats

<Warning>
  Careful, the route starts with `/v2/`. Make sure to include the version in the path.
</Warning>


## OpenAPI

````yaml post /v2/campaigns/stats/batch
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:
  /v2/campaigns/stats/batch:
    post:
      tags:
        - Campaigns
      summary: Get Batch Campaign Stats
      description: >-
        Retrieve detailed statistics for multiple campaigns in a single request,
        with filtering options by date, user, A/B testing, and communication
        channels. Processes up to 100 campaigns per request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - campaignIds
                - startDate
                - endDate
              properties:
                campaignIds:
                  type: array
                  items:
                    type: string
                  minItems: 1
                  maxItems: 100
                  description: Array of campaign IDs to retrieve stats for
                  example:
                    - cam_123
                    - cam_456
                startDate:
                  type: string
                  description: Start date in ISO 8601 format
                  example: '2024-01-07T22:00:00.000Z'
                endDate:
                  type: string
                  description: End date in ISO 8601 format
                  example: '2025-07-10T21:59:59.999Z'
                sendUser:
                  type: string
                  description: >-
                    Filter stats by send user. Format:
                    `sendUserId|sendUserEmail`. The sendUserId should begin with
                    'usr_' and the sendUserEmail should be a valid sender email.
                    If the param is specified, both sendUserId and sendUserEmail
                    are mandatory.
                  example: usr_OcIHizJyIeaDxicQP|email@example.com
                ABSelected:
                  type: string
                  enum:
                    - A
                    - B
                  description: A/B version filter
                channels:
                  type: array
                  items:
                    type: string
                    enum:
                      - email
                      - linkedin
                      - others
                  description: Filter by communication channels
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    description: Array of campaign stats results
                    items:
                      type: object
                      properties:
                        campaignId:
                          type: string
                          description: The campaign ID
                        nbLeads:
                          type: integer
                          description: Total number of leads in the campaign
                        nbLeadsLaunched:
                          type: integer
                          description: Number of leads launched in the campaign
                        nbLeadsReached:
                          type: integer
                          description: Number of leads that were successfully reached
                        nbLeadsOpened:
                          type: integer
                          description: Number of leads that opened messages
                        nbLeadsInteracted:
                          type: integer
                          description: >-
                            Number of leads that interacted with messages
                            (clicked, replied)
                        nbLeadsAnswered:
                          type: integer
                          description: Number of leads that answered
                        nbLeadsInterested:
                          type: integer
                          description: Number of leads marked as interested
                        nbLeadsNotInterested:
                          type: integer
                          description: Number of leads marked as not interested
                        nbLeadsUnsubscribed:
                          type: integer
                          description: Number of leads that unsubscribed
                        nbLeadsInterrupted:
                          type: integer
                          description: Number of leads with interrupted sequences
                        messagesSent:
                          type: integer
                          description: Total number of messages sent
                        messagesNotSent:
                          type: integer
                          description: Number of messages that failed to send
                        messagesBounced:
                          type: integer
                          description: Number of messages that bounced
                        delivered:
                          type: integer
                          description: Number of messages successfully delivered
                        opened:
                          type: integer
                          description: Number of messages opened
                        clicked:
                          type: integer
                          description: Number of messages with clicks
                        replied:
                          type: integer
                          description: Number of messages that received replies
                        invitationAccepted:
                          type: integer
                          description: Number of LinkedIn invitations accepted
                        meetingBooked:
                          type: integer
                          description: Number of meetings booked
                        steps:
                          type: array
                          description: Detailed metrics for each step in the campaign
                          items:
                            type: object
                            properties:
                              index:
                                type: integer
                                description: Step index in the sequence
                              sequenceId:
                                type: string
                                description: ID of the sequence
                              sequenceStep:
                                type: integer
                                description: Step number within the sequence
                              abTest:
                                type: string
                                description: A/B test variant (if applicable)
                              taskType:
                                type: string
                                description: Type of task
                                enum:
                                  - email
                                  - linkedinVisit
                                  - linkedinInvite
                                  - linkedinSend
                                  - phone
                                  - manual
                                  - conditional
                              conditionLabel:
                                type: string
                                description: Label for conditional steps
                              invited:
                                type: integer
                                description: Number of LinkedIn invitations sent
                              sent:
                                type: integer
                                description: Number of messages sent
                              delivered:
                                type: integer
                                description: Number of messages delivered
                              opened:
                                type: integer
                                description: Number of messages opened
                              clicked:
                                type: integer
                                description: Number of clicks from a message from this step
                              replied:
                                type: integer
                                description: Number of replies
                              notDelivered:
                                type: integer
                                description: Number of messages not delivered
                              bounced:
                                type: integer
                                description: Number of messages bounced
                              unsubscribed:
                                type: integer
                                description: Number of unsubscribes from this step
                  errors:
                    type: array
                    description: >-
                      Array of errors for campaigns that failed to retrieve
                      stats
                    items:
                      type: object
                      properties:
                        campaignId:
                          type: string
                          description: The campaign ID that failed
                        error:
                          type: string
                          description: Error message
              example:
                results:
                  - campaignId: cam_123
                    nbLeads: 32
                    nbLeadsLaunched: 32
                    nbLeadsReached: 32
                    nbLeadsOpened: 31
                    nbLeadsInteracted: 4
                    nbLeadsAnswered: 16
                    nbLeadsInterested: 1
                    nbLeadsNotInterested: 0
                    nbLeadsUnsubscribed: 1
                    nbLeadsInterrupted: 1
                    messagesSent: 72
                    messagesNotSent: 0
                    messagesBounced: 0
                    delivered: 72
                    opened: 47
                    clicked: 4
                    replied: 16
                    invitationAccepted: 0
                    meetingBooked: 0
                    steps:
                      - index: 1
                        sequenceId: seq_rH5RD3fMkkt2gM3YC
                        sequenceStep: 0
                        taskType: linkedinSend
                        invited: 0
                        sent: 32
                        delivered: 32
                        opened: 15
                        clicked: 0
                        replied: 15
                        notDelivered: 0
                        bounced: 0
                        unsubscribed: 1
                errors: []
        '400':
          description: Bad request - Invalid parameters
          content:
            text/plain:
              examples:
                emptyCampaignIds:
                  summary: Empty campaign IDs
                  value: 'Bad params: campaignIds must be a non-empty array'
                tooManyCampaignIds:
                  summary: Too many campaign IDs
                  value: 'Bad params: campaignIds must contain at most 100 items'
                missingDates:
                  summary: Missing dates
                  value: 'Bad params: startDate and endDate are required'
                invalidChannels:
                  summary: Invalid channels
                  value: >-
                    Bad params: channels must be an array of "others", "email"
                    or "linkedin"
                invalidAB:
                  summary: Invalid A/B selection
                  value: 'Bad params: ABSelected must be A or B'
                invalidSendUserFormat:
                  summary: Invalid send user format
                  value: >-
                    Bad param format: sendUser must be formatted as follow:
                    <sendUserId>|<sendUserEmail>
                invalidSendUser:
                  summary: Send user email mismatch
                  value: >-
                    Bad params: the send user email is not related to the send
                    user id
        '401':
          description: Unauthorized
        '405':
          description: Method not allowed
          content:
            text/plain:
              example: Bad method
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````