> ## 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: []
tags:
  - name: Enrichment Providers
    description: >-
      The data providers lemlist can call to find an email or a phone.


      Internal providers are paid with lemlist credits and always available.
      External providers run on your own account: connect one by saving its API
      key, and it becomes available to your waterfalls. `GET
      /enrichments/providers` is the catalog of provider ids accepted by the
      waterfall endpoints.
  - name: Enrichment Waterfalls
    description: >-
      Control which data providers lemlist calls when enriching a contact, and
      in which order.


      A waterfall is an ordered list of providers for one enrichment `type`
      (`email` or `phone`). Providers are tried one after the other until one
      returns a result.


      Every team has exactly one default waterfall per type (`isDefault: true`).
      While its `editor` is `lemlist` it follows the lemlist behaviour:
      providers you connected with your own API key are tried first, then
      internal providers in a random order. Once a team member edits its
      provider list, `editor` becomes that user's id and the list is followed as
      is; resetting it hands it back to `lemlist`.


      Custom waterfalls (`isDefault: false`) carry `conditions` on the contact
      being enriched, keyed by contact property; every key present must match.
      When a contact is enriched, lemlist runs a single waterfall: the custom
      waterfall of the requested type whose conditions match the contact, or the
      default waterfall when none does. If several match, the one with the most
      condition keys wins, then the most recently updated. Only that waterfall
      runs; when it finds nothing, the enrichment ends without falling back to
      another one.
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
                        perChannel:
                          $ref: '#/components/schemas/CampaignPerChannelStats'
                        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: 4
                    messagesBounced: 0
                    delivered: 72
                    opened: 47
                    clicked: 4
                    replied: 16
                    invitationAccepted: 0
                    meetingBooked: 0
                    perChannel:
                      email:
                        sent: 40
                        delivered: 40
                        notDelivered: 0
                        opened: 32
                        clicked: 4
                        replied: 1
                        bounced: 0
                        unsubscribed: 0
                      linkedin:
                        sent: 32
                        delivered: 32
                        notDelivered: 4
                        opened: 15
                        replied: 15
                        invitationAccepted: 0
                        breakdown:
                          sent:
                            messages: 24
                            inMails: 5
                            voiceNotes: 3
                          notDelivered:
                            messages: 3
                            inMails: 1
                            voiceNotes: 0
                      sms:
                        sent: 0
                        delivered: 0
                        notDelivered: 0
                        replied: 0
                      whatsapp:
                        sent: 0
                        delivered: 0
                        notDelivered: 0
                        opened: 0
                        replied: 0
                      others:
                        unsubscribed: 1
                        interested: 1
                        notInterested: 0
                    steps:
                      - index: 1
                        sequenceId: seq_rH5RD3fMkkt2gM3YC
                        sequenceStep: 0
                        taskType: linkedinSend
                        invited: 0
                        sent: 32
                        delivered: 32
                        opened: 15
                        clicked: 0
                        replied: 15
                        notDelivered: 4
                        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:
  schemas:
    CampaignPerChannelStats:
      type: object
      description: >-
        Campaign counters split by channel. Only the channels requested through
        the `channels` parameter are returned; when `channels` is omitted, all
        five are present.
      properties:
        email:
          type: object
          description: Email counters.
          properties:
            sent:
              type: integer
              description: Emails sent.
            delivered:
              type: integer
              description: Emails sent that did not bounce.
            notDelivered:
              type: integer
              description: Emails that failed to send.
            opened:
              type: integer
              description: Emails opened.
            clicked:
              type: integer
              description: Emails with a link clicked.
            replied:
              type: integer
              description: Emails replied to.
            bounced:
              type: integer
              description: Emails that bounced.
            unsubscribed:
              type: integer
              description: Unsubscribes from emails.
        linkedin:
          type: object
          description: >-
            LinkedIn counters. `sent` covers message sends only — regular
            messages, InMails and voice notes. It excludes invitations and
            non-message actions such as profile visits, follows, likes, comments
            and endorsements.
          properties:
            sent:
              type: integer
              description: LinkedIn messages successfully sent, across the three sub-types.
            delivered:
              type: integer
              description: >-
                Always equal to `sent`. LinkedIn has no delivery confirmation
                distinct from the send itself, so a LinkedIn delivery rate is
                always 100% and carries no information.
            notDelivered:
              type: integer
              description: >-
                Send attempts that failed. Disjoint from `sent` — a failed
                attempt is never also counted as sent — so the share of attempts
                that failed is `notDelivered / (sent + notDelivered)`.
            opened:
              type: integer
              description: LinkedIn messages opened.
            replied:
              type: integer
              description: LinkedIn messages replied to.
            invitationAccepted:
              type: integer
              description: LinkedIn invitations accepted.
            breakdown:
              type: object
              description: >-
                `sent` and `notDelivered` split by message sub-type. Each trio
                sums to the counter of the same name above.
              properties:
                sent:
                  $ref: '#/components/schemas/LinkedinSubTypeCounts'
                notDelivered:
                  $ref: '#/components/schemas/LinkedinSubTypeCounts'
        sms:
          type: object
          description: SMS counters.
          properties:
            sent:
              type: integer
              description: SMS sent.
            delivered:
              type: integer
              description: SMS delivered.
            notDelivered:
              type: integer
              description: SMS that failed to send.
            replied:
              type: integer
              description: SMS replied to.
        whatsapp:
          type: object
          description: WhatsApp counters, messages and voice notes combined.
          properties:
            sent:
              type: integer
              description: WhatsApp messages sent.
            delivered:
              type: integer
              description: WhatsApp messages delivered.
            notDelivered:
              type: integer
              description: WhatsApp messages that failed to send.
            opened:
              type: integer
              description: WhatsApp messages opened.
            replied:
              type: integer
              description: WhatsApp messages replied to.
        others:
          type: object
          description: >-
            Counters that belong to no messaging channel — API-driven and manual
            activities, fused to mirror the single entry of the in-app channel
            filter.
          properties:
            unsubscribed:
              type: integer
              description: Unsubscribes.
            interested:
              type: integer
              description: Leads marked as interested.
            notInterested:
              type: integer
              description: Leads marked as not interested.
    LinkedinSubTypeCounts:
      type: object
      description: >-
        A LinkedIn counter split by message sub-type. The three values sum to
        the aggregated counter of the same name on `perChannel.linkedin`. All
        three keys are always present, `0` when there is no matching activity.
      properties:
        messages:
          type: integer
          description: Regular LinkedIn messages.
        inMails:
          type: integer
          description: InMails.
        voiceNotes:
          type: integer
          description: LinkedIn voice notes.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.