openapi: 3.1.0
info:
  title: La Growth Machine API
  version: 1.0.0
  description: |-
    ## 👋 Welcome to the La Growth Machine API Documentation

    Here you'll find all our external APIs, designed to help you build custom use cases and access your data in an ultra-personalized way.

    Our goal: give you maximum flexibility to integrate LGM into your tools, automate your workflows, or enrich your dashboards.

    🚀 **Got ideas or feedback?** We’d love to hear from you!

    * * *

    ## How to Debug – API Logs History

    You can monitor and debug your API usage directly from the LGM app.

    Go to [https://app.lagrowthmachine.com/settings/api](https://app.lagrowthmachine.com/settings/api) _(login required)_

    There, you’ll find a **complete history of your API calls**, including:

    *   The endpoint used (e.g., `Create Lead`, `List Audiences`)
        
    *   The execution status (✅ success or ❌ error)
        
    *   A summary of the result (e.g., “139 audiences returned”)
        
    *   Timestamp of the call
        
    *   A toggle to filter only failed requests
        

    This helps you quickly verify what happened, debug issues, or confirm data updates.

    > 🧠 Tip: Always check this log if your integration doesn’t behave as expected — it’s your first line of debugging!

    # Authentication

    All API requests to La Growth Machine must be authenticated using an **API key**.

    **Base URL:** `https://apiv2.lagrowthmachine.com/flow` — this is the main endpoint for all API requests.

    ## Get Your API Key

    You can retrieve your API key from your account settings:  
    [https://app.lagrowthmachine.com/settings/api](https://app.lagrowthmachine.com/settings/api)

    > ⚠️ You must be logged in to access this page.

    ## How to authenticate

    Authenticate with a **header**. Two header forms are supported — use whichever fits your client best.

    ### 1\. Authorization header (recommended)

    ```
    Authorization: Bearer YOUR_API_KEY

    ```

    Example:

    ```bash
    curl -H "Authorization: Bearer YOUR_API_KEY" \
      https://apiv2.lagrowthmachine.com/flow/members

    ```

    ### 2\. `x-api-key` header

    ```
    x-api-key: YOUR_API_KEY

    ```

    Example:

    ```bash
    curl -H "x-api-key: YOUR_API_KEY" \
      https://apiv2.lagrowthmachine.com/flow/members

    ```

    ### Deprecated: query string

    ```
    ?apikey=YOUR_API_KEY

    ```

    Example:

    ```
    GET https://apiv2.lagrowthmachine.com/flow/members?apikey=YOUR_API_KEY

    ```

    > ⚠️ Never share your API key publicly. It provides full access to your account's data. Passing it in the query string exposes it in server logs, browser history and `Referer` headers. It remains supported for backward compatibility, and for the Website visitor webhooks whose third-party dashboards accept a URL only.

    ## Test your key

    You can test your authentication by sending a request to the `/members` endpoint.

    Request:

    ```bash
    curl -H "Authorization: Bearer YOUR_API_KEY" \
      https://apiv2.lagrowthmachine.com/flow/members

    ```

    Expected response:

    ```json
    [
      {
        "id": "lgm-member-id",
        "name": "Boris T.",
        "label": "Boris T."
      }
    ]

    ```

    # Rate Limiting

    To ensure fair and stable usage, API access is limited to:

    *   **50 calls per 10 seconds per API key**

    If you exceed this limit, requests will be temporarily rejected with a `429 Too Many Requests` error.

    * * *

    ### Best Practices

    *   Add retry logic with exponential backoff.
        
    *   Avoid unnecessary polling or tight loops.
        
    *   Cache data when possible to reduce redundant calls.
servers:
  - url: https://apiv2.lagrowthmachine.com/flow
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: Campaigns
    description: Use these endpoints to list all your campaigns, get detailed information about a specific one, and analyze their performance.
  - name: Audiences
  - name: Identities
    description: We currently provide an endpoint to **list all your connected identities**, as the `identity.id` is required in several APIs such as sending a LinkedIn or Email message.
  - name: Leads
  - name: Members
    description: |-
      Use this endpoint to retrieve the list of **members (users)** associated with your workspace.

      ### Why is this useful?

      For some advanced features — especially around **Inbox messages and webhooks** — you need to identify **which member performed an action**.

      Some action-based endpoints (like sending a LinkedIn or Email message) require you to specify the **`memberId`** who will perform the action.

      This ID represents the teammate inside your workspace, and ensures the action is executed in their name.

      This ID is important for correctly attributing actions, handling replies, or applying custom rules based on the sender.
  - name: Inbox
    description: |-
      ## Inbox Note

      This endpoint allows you to update the note (PostIt) attached to an inbox conversation. Notes are short text annotations visible in the LGM inbox, useful for adding context, CRM sync data, or any custom information about a lead's conversation.

      * * *

      ### Use cases

      *   CRM Sync: Automatically push CRM deal stage, score, or status into the conversation note from tools like HubSpot, Salesforce, or Pipedrive via webhooks/Zapier.
          
      *   Enrichment Data: After enriching a lead externally, append qualification info (company size, funding round, tech stack) to the conversation note.
          
      *   Sales Notes: Let your sales team push call summaries or meeting notes from an external tool directly into the LGM inbox.
          
      *   Workflow Automation: Use Make/Zapier/n8n to automatically tag conversations with relevant context when a lead replies or triggers an event.
          
      *   Lead Scoring: Append a lead score update each time it changes, keeping a timestamped history in the note.
          

      * * *

      ### How to Identify a Conversation

      You must provide **at least one** of the following identifiers to target a conversation:

      **Identifier**

      **description**

      conversationId: string

      Direct conversationId

      leadId: string

      The system finds the associated conversation

      email: string

      Lead's email address. The system looks up the lead, then the conversation.

      linkedinUrl: string

      Lead's LinkedIn profile URL. The system looks up the lead, then the conversation.

      * * *

      ### Disambiguation (when using \`leadId\`, \`email\`, or \`linkedinUrl\`)

      A lead can have **multiple conversations** (one per identity/channel).

      If that's the case, the API returns an error asking you to be more specific. You can narrow down using these optional filters:

      **Optionnal filters**

      **Description**

      identityId

      Target the conversation linked to a specific identity.

      campaignId

      Target the conversation linked to a specific campaign.

      campaignName

      Target the conversation linked to a campaign by its name.

      > **Tip:** If you know the \`conversationId\`, use it directly. It's the fastest and most reliable lookup method.

      ### Modes

      #### `replace` (default)

      Replaces the entire note with the new content. If the note exceeds 1500 characters, it is truncated.

      #### `append`

      Appends the new content to the existing note, separated by a timestamp:

      ```
      Existing note content
      -- 2026-02-19 14:30 --
      New appended content

      ```

      If the combined note exceeds 1500 characters, the **oldest content is removed** from the beginning to make room for the new entry.

      * * *

      ### Lookup Priority

      When multiple identifiers are provided, the system resolves them in this order:

      1.  **`conversationId`** - Direct lookup, ignores other identifiers.
          
      2.  **`leadId`** - Finds the lead by ID, then searches for its conversation.
          
      3.  **`email`** - Finds the lead by email, then searches for its conversation.
          
      4.  **`linkedinUrl`** - Finds the lead by LinkedIn URL, then searches for its conversation.
          

      For conversation disambiguation (when a lead has multiple conversations):

      1.  **`identityId`** - Direct match on identity.
          
      2.  **`campaignId`** - Resolves the campaign, then uses its identity.
          
      3.  **`campaignName`** - Resolves the campaign by name, then uses its identity.
          
      4.  **No filter** - Works only if the lead has exactly one conversation. Fails if multiple exist.
          

      * * *

      ### Limits

      Constraint

      Value

      Max note length

      1500 characters

      Truncation behavior (replace)

      Truncated from the end

      Truncation behavior (append)

      Oldest content removed from the beginning

      Append separator format

      `\n-- YYYY-MM-DD HH:mm --\n` (UTC)

      ## Inbox Webhooks

      Use these endpoints to manage your **Inbox Webhooks**, which allow you to receive real-time notifications about messages sent or received by your leads.

      * * *

      ### What does an Inbox Webhook do?

      Once created, an Inbox Webhook will push:

      *   **LinkedIn messages** (sent or received)
          
      *   **Email messages** (sent or received)
          

      for **all your leads, identities, and campaigns** by default.

      **However, you can also target specific campaigns by providing their** **`campaignId`** **in the webhook creation payload.**

      * * *

      ### Webhook Lifecycle

      *   When you create a webhook, it returns a unique `id`.
          
      *   You can later **delete** this webhook using the `DELETE /inbox/:id` endpoint.
          

      * * *

      ### Webhook Requirements

      To ensure successful delivery, your webhook endpoint must:

      *   Be **publicly accessible** and support `POST` requests.
          
      *   **Respond with HTTP 200 OK**.
          
      *   **Respond quickly** (within 3 seconds max).
          
      *   Return the response **immediately**, then handle any heavy processing asynchronously.
          

      > ℹ️ Failing to meet these requirements may result in delivery failures.

      * * *

      ### Filtering by Campaign

      When creating a webhook, you can optionally pass a list of `campaignIds` to restrict the webhook to those specific campaigns only.

      * * *

      ### Inbox Webhook Payload (Email or LinkedIn message)

      When a new message is sent or received by one of your leads, your webhook URL will receive a `POST` request with the following JSON payload.

      The payload includes:

      *   Information about the message (channel, subject, body…)
          
      *   Context about the conversation and sender identity
          
      *   Full lead information
          
      *   The **last 20 messages** from the conversation
          

      > ℹ️ The `messages` array always contains a maximum of **20 most recent messages**, ordered from newest to oldest.

      ### Example Payload

      ```json
      {
        "messageChannel": "EMAIL",
        "messageBody": "<span>Hello John, just following up on our last discussion.</span>&#013;\n",
        "messageSubject": "Follow-up on our meeting",
        "messageId": "abc123456789",
        "conversationId": "conv_987654321",
        "externalConversationId": "external_123456",
        "leadId": "lead_123456",
        "attachments": [],
        "identityId": "identity_001",
        "userId": "user_001",
        "createdAt": 1751003761000,
        "sent": true,
        "received": false,
        "campaignName": "Q2 Nurturing Campaign",
        "lead": {
          "id": "lead_123456",
          "jobTitle": "Marketing Manager",
          "gender": "woman",
          "shortBio": "Experienced B2B marketer",
          "dateOfBirth": "12/3",
          "persoEmail": "jane.doe@example.com",
          "picture": "https://example.com/images/jane-doe.jpg",
          "firstName": "Jane",
          "lastName": "Doe",
          "companyName": "GrowthTech Inc.",
          "companyWebsite": "https://growthtech.com",
          "industry": "Marketing & Advertising",
          "email": "jane.doe@growthtech.com",
          "linkedin": "https://linkedin.com/in/janedoe",
          "twitter": "@janedoemarketing",
          "phone": "+1234567890",
          "location": "San Francisco, CA"
        },
        "messages": [
          {
            "messageChannel": "EMAIL",
            "messageBody": "<span>Hello John, just following up on our last discussion.</span>&#013;\n",
            "messageSubject": "Follow-up on our meeting",
            "messageId": "abc123456789",
            "conversationId": "conv_987654321",
            "externalConversationId": "external_123456",
            "leadId": "lead_123456",
            "attachments": [],
            "identityId": "identity_001",
            "userId": "user_001",
            "createdAt": 1751003761000,
            "sent": true,
            "received": false,
            "campaignName": "Q2 Nurturing Campaign"
          },
          {
            "messageChannel": "LINKEDIN",
            "messageBody": "Looking forward to our call tomorrow!",
            "messageId": "abc987654321",
            "conversationId": "conv_987654321",
            "externalConversationId": "external_987654",
            "leadId": "lead_123456",
            "attachments": [],
            "identityId": "identity_002",
            "userId": "user_001",
            "createdAt": 1751003900000,
            "sent": true,
            "received": false,
            "campaignName": "Q2 Nurturing Campaign"
          }
        ]
      }

      ```

      * * *

      ### Message Deduplication Logic

      #### What happens if my lead sends multiple messages in a row?

      To avoid spamming your system with multiple webhook calls when a lead sends several messages in a short burst, La Growth Machine applies a **60-second deduplication window**.

      * * *

      #### What does that mean?

      If your lead sends 2 or more messages back-to-back (within 60 seconds), **you will receive only one webhook**, containing the **latest message** and the updated list of the last 20 messages from the conversation.

      This helps reduce noise, prevent duplicate processing, and keep your systems efficient.

      * * *

      #### Good to know

      *   The webhook is not triggered for every single message.
          
      *   A lead spamming messages in rapid succession will still result in **just one webhook call per 60 seconds**.
          
      *   You always get the latest state of the conversation, not just the last single message.
          

      > 💡 Tip: if you need to track every single message, consider storing the `messageId` values from the `messages[]` array to detect new messages manually.

      * * *

      ### Retry Policy

      If your webhook fails (e.g., times out or returns non-2xx status), La Growth Machine will attempt to **retry up to 5 times** before giving up.

      * * *

      ### 🚨 Abuse Protection

      Creating a large number of webhooks is unnecessary and may be considered abuse.  
      La Growth Machine reserves the right to **suspend or throttle webhooks** if abnormal usage is detected.
  - name: Website visitor
    description: |-
      ## Website Visitor Integrations

      La Growth Machine allows you to integrate with third-party website visitor tracking tools.  
      These integrations automatically push identified visitors into a selected audience within your LGM workspace — enabling real-time prospecting and follow-up.

      No code is required: you simply provide a webhook URL to the external platform, and leads are sent directly into your system.
  - name: Conversations
    description: |-
      # Search Conversations

      Search and paginate a user's inbox conversations through the LGM external API.

      GET {{baseUrl}}/flow/conversations/search

      ## What it does

      Returns a paginated, filtered list of inbox conversations for the account that owns  
      the API key. Use it to build an inbox view, sync conversations to an external tool,  
      or find conversations matching a lead/campaign/status.

      The endpoint does NOT return message bodies — only a lightweight conversation summary  
      (id, leadId, identityId, last message date/status/channel, conversation status).  
      To fetch the messages of a conversation, call:  
      GET {{baseUrl}}/flow/conversations/{conversationId}/messages

      ## Filtering

      All query parameters are optional. Without any filter, the most recent conversations are returned. List parameters are passed as comma-separated values, e.g. status=OPEN,SNOOZED.

      Key behaviours:

      *   identityIds Filter by identities (sending accounts).
      *   leadIds Filter by leads. CSV. Combined with q, the intersection is applied.
      *   audienceIds Filter by audiences.
      *   campaignIds Filter by campaigns. CSV. Each campaign is resolved into its audience + identity. Ignored if identityIds/audienceIds are already provided.
      *   status Conversation status: OPEN, SNOOZED, ARCHIVED.
      *   lastMessageStatus Last message status: RECEIVED, SENDING, SENT, SEND\_FAILED, INFO.
      *   lastMessageType Last message channel: LINKEDIN, EMAIL, INFO\_TEMPLATE\_SNOOZE, LGM, COMMENT, MANUAL\_TASK, AUTO\_QUALIFY.
      *   lastMessageAtFrom Lower bound (epoch ms) on the last message date.
      *   lastMessageAtTo Upper bound (epoch ms) on the last message date.
      *   callCompletedAtFrom Lower bound (epoch ms) on the call completion date.
      *   callCompletedAtTo Upper bound (epoch ms) on the call completion date.
      *   leadReplied true to keep only conversations where the lead replied.
      *   unsubscribed Filter on the lead unsubscribe status.
      *   favourite true to keep only conversations favourited by the member.
      *   read true = read by the member, false = unread by the member.
      *   limit Results per page. Min 1, max 100, default 25.
      *   searchAfter Pagination cursor. Pass the nextToken from the previous page.
      *   sortField Sort field: lastMessageAt (default), callCompletedAt, snoozeUntil.
      *   sortDirection Sort direction: -1 (descending, default) or 1 (ascending).

      ### Pagination (cursor based)

      The nextToken value is Base64 and may contain characters that are reserved in URLs  
      (such as `+`, `/`, `=`). Always URL-encode the token before passing it as searchAfter  
      (e.g. encodeURIComponent), otherwise the cursor will be corrupted and the request will fail.

      1.  Call without searchAfter -> response includes the exact `total` and a `nextToken`.
          
      2.  Call again with searchAfter=, keeping the same filters and sort.
          
      3.  Repeat while `hasMore` is true. On these pages `total` is null (not recomputed).
          

      ## Tips & recipes

      ### Conversations waiting for your reply (last message is from the lead), not archived

      A conversation is waiting on you when the last message was received from the lead  
      (status RECEIVED) and the conversation is still open.

      `?status=OPEN&lastMessageStatus=RECEIVED&leadReplied=true`

      *   status=OPEN excludes ARCHIVED (add SNOOZED if you also want snoozed ones: status=OPEN,SNOOZED)
          
      *   lastMessageStatus=RECEIVED the very last message came from the lead, so it's your turn
          
      *   leadReplied=true optional, guarantees the lead engaged in the thread
          

      ### Conversations untouched for at least a month, not archived

      Last message older than one month" = upper-bound the last message date with a timestamp set to one month ago (epoch milliseconds). Not archived = keep OPEN (and SNOOZED if wanted).

      `?status=OPEN&lastMessageAtTo=1714824000000`

      *   lastMessageAtTo= only conversations whose last message is BEFORE this date
          
      *   replace the value with "now minus 30 days" (see tip below)
          

      ### Computing a "one month ago" timestamp in Postman

      Add this in the request's Pre-request Script tab, then use {{oneMonthAgo}} as the value:

      const oneMonthAgo = Date.now() - 30 \* 24 \* 60 \* 60 \* 1000;

      `?status=OPEN&lastMessageAtTo={{oneMonthAgo}}`

      ### Combine filters freely

      Filters are AND-ed together. Example — stale open LinkedIn threads the lead replied to:  
      `?status=OPEN&lastMessageType=LINKEDIN&leadReplied=true&lastMessageAtTo={{oneMonthAgo}}`

      * * *

      # Manage Inbox Conversation Actions API

      This API lets you manage the state of your **LaGrowthMachine inbox conversations** programmatically, straight from your own tools and automations (Make, n8n, Zapier, or any custom backend). Instead of manually opening the LGM inbox, you can archive, restore, snooze, or wake up conversations as part of your workflows.

      Use it to keep your inbox clean and focused:

      *   **Archive / Unarchive** — Move a conversation out of your active inbox once it's been handled (e.g. after a reply was logged in your CRM, a deal was closed, or a lead was disqualified), and bring it back whenever you need it again.
      *   **Snooze / Unsnooze** — Temporarily hide a conversation until a date you choose (for example, _"follow up next Monday"_). The conversation automatically reappears in your inbox when that date is reached — no extra call needed. You can also wake it up early at any time.

      ## Targeting a conversation

      Every endpoint targets a conversation through a **flexible identifier** — you don't need to know LGM's internal conversation ID. Just pass whatever you already have:

      *   `email` — the lead's email
      *   `linkedinUrl` — the lead's LinkedIn URL
      *   `leadId` — the lead's ID
      *   `conversationId` — the conversation's ID

      If a lead has several conversations, narrow it down with `identityId`, `campaignId`, or `campaignName`.

      ## Typical use cases

      *   Auto-archive a conversation when your CRM marks the deal as won or lost.
      *   Snooze a lead until a scheduled follow-up date pulled from your pipeline.
      *   Re-open (unarchive) a conversation when a lead replies or a new task is created.
  - name: Credits
  - name: CRM
paths:
  /campaigns/{campaignId}:
    get:
      tags:
        - Campaigns
      summary: Get Campaign
      operationId: getCampaign
      description: "## Use this endpoint to get one campaign"
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
          description: Campaign ID
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                getCampaign:
                  summary: Get Campaign
                  value:
                    statusCode: 200
                    campaign:
                      id: 34b5349b5490f3dec0b32043
                      name: My Campaign
                      description: ""
                      language: french
                      createdAt: 1689597083378
                      modifiedAt: 1700461831358
                      launchedAt: 1689597085594
                      userId: 621dc8c3fc32136ebee8c0f2
                      status: PAUSED
                      audienceName: "Tests #1"
                      audienceSize: 0
                      channels:
                        - LGM
                        - GOOGLE
                      identityId: 63bc0ada94af5e7aa95c4df2
                      identityFirstname: John
                      identityLastname: Doe
                      converted: 0
                      activated: 0
                      hubspot: false
                      pipedrive: false
                      enrich: false
                      autoRescheduleOutOfOffice: true
                      ignoreEmojiOnlyReply: false
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  campaign:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      description:
                        type: string
                      language:
                        type: string
                      createdAt:
                        type: integer
                      modifiedAt:
                        type: integer
                      launchedAt:
                        type: integer
                      userId:
                        type: string
                      status:
                        type: string
                      audienceName:
                        type: string
                      audienceSize:
                        type: integer
                      channels:
                        type: array
                        items:
                          type: string
                      identityId:
                        type: string
                      identityFirstname:
                        type: string
                      identityLastname:
                        type: string
                      converted:
                        type: integer
                      activated:
                        type: integer
                      hubspot:
                        type: boolean
                      pipedrive:
                        type: boolean
                      enrich:
                        type: boolean
                      autoRescheduleOutOfOffice:
                        type: boolean
                      ignoreEmojiOnlyReply:
                        type: boolean
  /campaigns:
    get:
      tags:
        - Campaigns
      summary: Get Campaigns
      operationId: getCampaigns
      description: |-
        ### Get All Campaigns

        Use this endpoint to retrieve **all your campaigns**.

        * * *

        ### Pagination

        This endpoint supports pagination using the `skip` and `limit` query parameters:

        *   `limit` → number of items to return (default: 25)
        *   `skip` → number of items to skip (used to navigate pages)

        **Examples:**

        *   Page 1 → `?skip=0&limit=25`
        *   Page 2 → `?skip=25&limit=25`
        *   Page 3 → `?skip=50&limit=25`

        You can adjust these values depending on your pagination logic.
      parameters:
        - name: skip
          in: query
          required: false
          schema:
            type: string
          description: Skip results per queries (0 minimum)
        - name: limit
          in: query
          required: false
          schema:
            type: string
          description: Limit of result per queries (25 max)
      responses:
        "200":
          description: OK
  /campaigns/{campaignId}/stats:
    get:
      tags:
        - Campaigns
      summary: Get Campaign Stats
      operationId: getCampaignStats
      description: "## Use this endpoint to get stats from your campaign"
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
          description: Campaign ID
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                getCampaignStats:
                  summary: Get Campaign stats
                  value:
                    statusCode: 200
                    engagementStats:
                      campaignId: 64b2249b5490f3dec0b320f3
                      audienceSize: 1
                      converted: 1
                      completed: 0
                      started: 1
                      replies:
                        contacted: 1
                        replied: 1
                        linkedinContacted: 0
                        emailContacted: 1
                        linkedinReplied: 0
                        emailReplied: 1
                        contactedPercent: 100
                        totalReplyPercent: 100
                        contactedReplyPercent: 100
                        linkedinContactedReplyPercent: 0
                        emailContactedReplyPercent: 100
                      relations:
                        activated: false
                        requestSent: 0
                        relations: 0
                        newRelations: 0
                        alreadyConnected: 0
                        requestSentPercent: 0
                        relationsPercent: 0
                        totalRelationsPercent: 0
                        newRelationsPercent: 0
                        alreadyConnectedPercent: 0
                      channel:
                        email:
                          activated: true
                          sent: 1
                          received: 1
                          opened: 1
                          replied: 1
                          clicked: 0
                          bounced: 0
                          sentPercent: 100
                          receivedPercent: 100
                          openedPercent: 100
                          repliedPercent: 100
                          clickedPercent: 0
                          bouncedPercent: 0
                        linkedin:
                          activated: false
                          contactRequest:
                            activated: false
                            sent: 0
                            newRelations: 0
                            alreadyContact: 0
                            sentPercent: 0
                            newRelationsPercent: 0
                            alreadyContactPercent: 0
                          message:
                            sent: 0
                            replied: 0
                            sentPercent: 0
                            repliedPercent: 0
                        twitter:
                          activated: false
                          sent: 0
                          retweet: 0
                          favorited: 0
                          followed: 0
                          followBack: 0
                          followedPercent: 0
                          followBackPercent: 0
                        enrich:
                          activated: false
                          proUpgrade: false
                          businessUpgrade: false
                          enriched: 0
                          found:
                            profile: 0
                            profileSearch: 0
                            website: 0
                            proEmail: 0
                            persoEmail: 0
                            phone: 0
                            twitter: 0
                            profilePercent: 0
                            profileSearchPercent: 0
                            profileOnProfileSearchPercent: 0
                            websitePercent: 0
                            proEmailPercent: 0
                            persoEmailPercent: 0
                            phonePercent: 0
                            twitterPercent: 0
                          enrichedPercent: 0
                      status:
                        activated:
                          total: 1
                          activated: 1
                          enriched: 0
                          contacted: 1
                          completed: 0
                          outOfOffice: 0
                          activatedPercent: 100
                          enrichedPercent: 0
                          contactedPercent: 100
                          completedPercent: 0
                          audiencePercent: 100
                          contactedAudiencePercent: 100
                          outOfOfficePercent: 0
                        replied:
                          total: 1
                          toQualify: 0
                          wrongTiming: 0
                          toQualifyPercent: 0
                          wrongTimingPercent: 0
                          audiencePercent: 100
                          activatedPercent: 100
                          contactedPercent: 100
                        won:
                          total: 0
                          interested: 0
                          callBooked: 0
                          negotiating: 0
                          readyToBuy: 0
                          converted: 0
                          interestedPercent: 0
                          callBookedPercent: 0
                          negotiatingPercent: 0
                          readyToBuyPercent: 0
                          convertedPercent: 0
                          audiencePercent: 0
                          repliedPercent: 0
                        lost:
                          total: 0
                          wrongTarget: 0
                          notInterested: 0
                          alreadyEquipped: 0
                          unsubscribed: 0
                          wrongTargetPercent: 0
                          notInterestedPercent: 0
                          alreadyEquippedPercent: 0
                          unsubscribedPercent: 0
                          audiencePercent: 0
                          repliedPercent: 0
                      templates:
                        - sent: 1
                          opened: 1
                          clicked: 0
                          replied: 1
                          bounced: 0
                          openedPercent: 100
                          clickedPercent: 0
                          repliedPercent: 100
                          bouncedPercent: 0
                          channel: GOOGLE
                          createdAt: 1689597083345
                          description: <span>Description</span><br>
                          name: "Email Intro #1"
                          subjectHtml: |
                            Hi, this is my template
                          type: TEXT
                          position: 0
                          templateId: 690d7b4566dc409f688z4dfe
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  engagementStats:
                    type: object
                    properties:
                      campaignId:
                        type: string
                      audienceSize:
                        type: integer
                      converted:
                        type: integer
                      completed:
                        type: integer
                      started:
                        type: integer
                      replies:
                        type: object
                        properties:
                          contacted:
                            type: integer
                          replied:
                            type: integer
                          linkedinContacted:
                            type: integer
                          emailContacted:
                            type: integer
                          linkedinReplied:
                            type: integer
                          emailReplied:
                            type: integer
                          contactedPercent:
                            type: integer
                          totalReplyPercent:
                            type: integer
                          contactedReplyPercent:
                            type: integer
                          linkedinContactedReplyPercent:
                            type: integer
                          emailContactedReplyPercent:
                            type: integer
                      relations:
                        type: object
                        properties:
                          activated:
                            type: boolean
                          requestSent:
                            type: integer
                          relations:
                            type: integer
                          newRelations:
                            type: integer
                          alreadyConnected:
                            type: integer
                          requestSentPercent:
                            type: integer
                          relationsPercent:
                            type: integer
                          totalRelationsPercent:
                            type: integer
                          newRelationsPercent:
                            type: integer
                          alreadyConnectedPercent:
                            type: integer
                      channel:
                        type: object
                        properties:
                          email:
                            type: object
                            properties:
                              activated:
                                type: boolean
                              sent:
                                type: integer
                              received:
                                type: integer
                              opened:
                                type: integer
                              replied:
                                type: integer
                              clicked:
                                type: integer
                              bounced:
                                type: integer
                              sentPercent:
                                type: integer
                              receivedPercent:
                                type: integer
                              openedPercent:
                                type: integer
                              repliedPercent:
                                type: integer
                              clickedPercent:
                                type: integer
                              bouncedPercent:
                                type: integer
                          linkedin:
                            type: object
                            properties:
                              activated:
                                type: boolean
                              contactRequest:
                                type: object
                                properties:
                                  activated:
                                    type: boolean
                                  sent:
                                    type: integer
                                  newRelations:
                                    type: integer
                                  alreadyContact:
                                    type: integer
                                  sentPercent:
                                    type: integer
                                  newRelationsPercent:
                                    type: integer
                                  alreadyContactPercent:
                                    type: integer
                              message:
                                type: object
                                properties:
                                  sent:
                                    type: integer
                                  replied:
                                    type: integer
                                  sentPercent:
                                    type: integer
                                  repliedPercent:
                                    type: integer
                          twitter:
                            type: object
                            properties:
                              activated:
                                type: boolean
                              sent:
                                type: integer
                              retweet:
                                type: integer
                              favorited:
                                type: integer
                              followed:
                                type: integer
                              followBack:
                                type: integer
                              followedPercent:
                                type: integer
                              followBackPercent:
                                type: integer
                          enrich:
                            type: object
                            properties:
                              activated:
                                type: boolean
                              proUpgrade:
                                type: boolean
                              businessUpgrade:
                                type: boolean
                              enriched:
                                type: integer
                              found:
                                type: object
                                properties:
                                  profile:
                                    type: integer
                                  profileSearch:
                                    type: integer
                                  website:
                                    type: integer
                                  proEmail:
                                    type: integer
                                  persoEmail:
                                    type: integer
                                  phone:
                                    type: integer
                                  twitter:
                                    type: integer
                                  profilePercent:
                                    type: integer
                                  profileSearchPercent:
                                    type: integer
                                  profileOnProfileSearchPercent:
                                    type: integer
                                  websitePercent:
                                    type: integer
                                  proEmailPercent:
                                    type: integer
                                  persoEmailPercent:
                                    type: integer
                                  phonePercent:
                                    type: integer
                                  twitterPercent:
                                    type: integer
                              enrichedPercent:
                                type: integer
                      status:
                        type: object
                        properties:
                          activated:
                            type: object
                            properties:
                              total:
                                type: integer
                              activated:
                                type: integer
                              enriched:
                                type: integer
                              contacted:
                                type: integer
                              completed:
                                type: integer
                              outOfOffice:
                                type: integer
                              activatedPercent:
                                type: integer
                              enrichedPercent:
                                type: integer
                              contactedPercent:
                                type: integer
                              completedPercent:
                                type: integer
                              audiencePercent:
                                type: integer
                              contactedAudiencePercent:
                                type: integer
                              outOfOfficePercent:
                                type: integer
                          replied:
                            type: object
                            properties:
                              total:
                                type: integer
                              toQualify:
                                type: integer
                              wrongTiming:
                                type: integer
                              toQualifyPercent:
                                type: integer
                              wrongTimingPercent:
                                type: integer
                              audiencePercent:
                                type: integer
                              activatedPercent:
                                type: integer
                              contactedPercent:
                                type: integer
                          won:
                            type: object
                            properties:
                              total:
                                type: integer
                              interested:
                                type: integer
                              callBooked:
                                type: integer
                              negotiating:
                                type: integer
                              readyToBuy:
                                type: integer
                              converted:
                                type: integer
                              interestedPercent:
                                type: integer
                              callBookedPercent:
                                type: integer
                              negotiatingPercent:
                                type: integer
                              readyToBuyPercent:
                                type: integer
                              convertedPercent:
                                type: integer
                              audiencePercent:
                                type: integer
                              repliedPercent:
                                type: integer
                          lost:
                            type: object
                            properties:
                              total:
                                type: integer
                              wrongTarget:
                                type: integer
                              notInterested:
                                type: integer
                              alreadyEquipped:
                                type: integer
                              unsubscribed:
                                type: integer
                              wrongTargetPercent:
                                type: integer
                              notInterestedPercent:
                                type: integer
                              alreadyEquippedPercent:
                                type: integer
                              unsubscribedPercent:
                                type: integer
                              audiencePercent:
                                type: integer
                              repliedPercent:
                                type: integer
                      templates:
                        type: array
                        items:
                          type: object
                          properties:
                            sent:
                              type: integer
                            opened:
                              type: integer
                            clicked:
                              type: integer
                            replied:
                              type: integer
                            bounced:
                              type: integer
                            openedPercent:
                              type: integer
                            clickedPercent:
                              type: integer
                            repliedPercent:
                              type: integer
                            bouncedPercent:
                              type: integer
                            channel:
                              type: string
                            createdAt:
                              type: integer
                            description:
                              type: string
                            name:
                              type: string
                            subjectHtml:
                              type: string
                            type:
                              type: string
                            position:
                              type: integer
                            templateId:
                              type: string
  /campaigns/{campaignId}/statsleads:
    get:
      tags:
        - Campaigns
      summary: Get Campaign Leads Stats
      operationId: getCampaignLeadsStats
      description: |-
        ## Use this endpoint to get all your leads stats from one campaign

        # \# Pagination

        Inside the query, use 1 parameter if you want to navigate over the results:

        `getLeadsAfter: string` or `getLeadsBefore: string`

        By using the `id` located in the `leads` array from the response, you will be able to get the list of leads before or ahead of this `id`

        # Each request will return 25 leads maximum.

        To get the first 25 leads, do not specify any query parameters

        To get the 25 next leads, use this `getLeadsAfter: lastLead.id`
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
          description: Campaign ID
        - name: getLeadsAfter
          in: query
          required: false
          schema:
            type: string
          description: Lead ID
        - name: getLeadsBefore
          in: query
          required: false
          schema:
            type: string
          description: Lead ID
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                usingGetLeadsBefore:
                  summary: Using getLeadsBefore
                  value:
                    statusCode: 200
                    leads:
                      - firstname: William
                        lastname: ""
                        companyName: null
                        companyUrl: null
                        phone: null
                        jobTitle: null
                        profilePicture: null
                        note: null
                        status: STARTED
                        id: 649b11a8d0d1ac9c33ca2fb2
                        email: exemple@exemple.com
                        linkedinUrl: https://linkedin.com/in/exemple
                        gender: null
                        industry: null
                        relationStatus: NOT_SENT
                        acceptationDate: null
                        replied: 0
                        action_todo: TO_REVIEW | TO_CALL | TO_QUALIFY
                        email_sent: 0
                        email_opened: 0
                        email_clicked: 0
                        email_replied: 0
                        linkedin_visit: 0
                        linkedin_dm_sent: 0
                        linkedin_audio_sent: 0
                        linkedin_replied: 0
                        linkedin_relation_status: NOT_SENT
                        twitter_tweeted: 0
                        twitter_retweeted: 0
                        twitter_favourited: 0
                        twitter_followed: 0
                        twitter_unfollowed: 0
                        twitter_dm_sent: 0
                        tweet_sent: 0
                        tag: COMPLETED_WITHOUT_REPLY
                        outOfOfficeReturnDate: null
                        outOfOfficeNextActionDate: null
                    count: 457
                    hasMore: true
                    hasLess: false
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  leads:
                    type: array
                    items:
                      type: object
                      properties:
                        firstname:
                          type: string
                        lastname:
                          type: string
                        companyName: {}
                        companyUrl: {}
                        phone: {}
                        jobTitle: {}
                        profilePicture: {}
                        note: {}
                        status:
                          type: string
                        id:
                          type: string
                        email:
                          type: string
                        linkedinUrl:
                          type: string
                        gender: {}
                        industry: {}
                        relationStatus:
                          type: string
                        acceptationDate: {}
                        replied:
                          type: integer
                        action_todo:
                          type: string
                        email_sent:
                          type: integer
                        email_opened:
                          type: integer
                        email_clicked:
                          type: integer
                        email_replied:
                          type: integer
                        linkedin_visit:
                          type: integer
                        linkedin_dm_sent:
                          type: integer
                        linkedin_audio_sent:
                          type: integer
                        linkedin_replied:
                          type: integer
                        linkedin_relation_status:
                          type: string
                        twitter_tweeted:
                          type: integer
                        twitter_retweeted:
                          type: integer
                        twitter_favourited:
                          type: integer
                        twitter_followed:
                          type: integer
                        twitter_unfollowed:
                          type: integer
                        twitter_dm_sent:
                          type: integer
                        tweet_sent:
                          type: integer
                        tag:
                          type: string
                        outOfOfficeReturnDate: {}
                        outOfOfficeNextActionDate: {}
                  count:
                    type: integer
                  hasMore:
                    type: boolean
                  hasLess:
                    type: boolean
  /campaigns/{campaignId}/messages:
    get:
      tags:
        - Campaigns
      summary: Get Campaign Messages
      operationId: getCampaignMessages
      description: |-
        Returns all message templates configured in a campaign's sequence.

        **Path Parameters:**

        *   `campaignId` (required) — MongoDB ObjectId (24-char hex string)

        **Response fields (per message template):**

        *   `id` — Template ID
        *   `type` — Template type
        *   `channel` — Channel (EMAIL, LINKEDIN, TWITTER, etc.)
        *   `contentHtml` — HTML content of the message
        *   `subjectHtml` — HTML subject (for emails)
        *   `order` — Position in the sequence
        *   `active` — Whether the template is active
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
          description: (Required) The campaign ID (24-char hex ObjectId)
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                success:
                  summary: Success
                  value:
                    statusCode: 200
                    data:
                      - id: 62f1a2b3c4d5e60078901234
                        type: INITIAL
                        channel: EMAIL
                        contentHtml: <p>Hi {{firstname}}, I noticed you work at {{companyName}}...</p>
                        subjectHtml: Quick question about {{companyName}}
                        order: 0
                        active: true
                      - id: 62f1a2b3c4d5e60078901235
                        type: FOLLOW_UP
                        channel: LINKEDIN
                        contentHtml: Hi {{firstname}}, just following up on my previous message...
                        subjectHtml: ""
                        order: 1
                        active: true
                    total: 2
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        channel:
                          type: string
                        contentHtml:
                          type: string
                        subjectHtml:
                          type: string
                        order:
                          type: integer
                        active:
                          type: boolean
                  total:
                    type: integer
  /campaigns/{campaignId}/settings:
    post:
      tags:
        - Campaigns
      summary: Update Campaign
      operationId: updateCampaign
      description: |-
        ## Use this endpoint to update the settings of one campaign

        Send only the settings you want to change. At least one of `name`, `audienceId`, `enrich`, `autoRescheduleOutOfOffice`, `hubspot`, `pipedrive`, `skipAlreadyContacted`, `ignoreEmojiOnlyReply` is required. The other settings of the campaign are left unchanged.

        Some settings depend on the campaign status:

        *   `audienceId`: can only be changed while the campaign has not been started yet (status `READY`).
        *   `hubspot` / `pipedrive`: the campaign must be paused, and your plan must include the CRM sync.
        *   `skipAlreadyContacted`: the campaign must be `READY` or `PAUSED`.
        *   `ignoreEmojiOnlyReply`: the campaign must be `READY` or `PAUSED`.

        The response returns the updated settings of the campaign.
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
          description: Campaign ID
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                renameACampaign:
                  summary: Rename a campaign
                  value:
                    statusCode: 200
                    data:
                      id: 34b5349b5490f3dec0b32043
                      name: My renamed campaign
                      audience:
                        id: 64f1c20b8a5d7e1234567890
                        name: "Tests #1"
                        size: 120
                      enrich: false
                      autoRescheduleOutOfOffice: true
                      hubspot: false
                      pipedrive: false
                      skipAlreadyContacted: true
                      status: PAUSED
                      ignoreEmojiOnlyReply: false
                assignAnAudienceCampaignNotStartedYet:
                  summary: Assign an audience (campaign not started yet)
                  value:
                    statusCode: 200
                    data:
                      id: 34b5349b5490f3dec0b32043
                      name: My Campaign
                      audience:
                        id: 64f1c20b8a5d7e1234567890
                        name: "Tests #1"
                        size: 120
                      enrich: false
                      autoRescheduleOutOfOffice: true
                      hubspot: false
                      pipedrive: false
                      skipAlreadyContacted: true
                      status: READY
                      ignoreEmojiOnlyReply: false
                enableHubSpotSyncCampaignPaused:
                  summary: Enable HubSpot sync (campaign paused)
                  value:
                    statusCode: 200
                    data:
                      id: 34b5349b5490f3dec0b32043
                      name: My Campaign
                      audience:
                        id: 64f1c20b8a5d7e1234567890
                        name: "Tests #1"
                        size: 120
                      enrich: false
                      autoRescheduleOutOfOffice: true
                      hubspot: true
                      pipedrive: false
                      skipAlreadyContacted: true
                      status: PAUSED
                      ignoreEmojiOnlyReply: false
                disableSkipAlreadyContactedAndAutoEnrich:
                  summary: Disable skip already contacted and auto-enrich
                  value:
                    statusCode: 200
                    data:
                      id: 34b5349b5490f3dec0b32043
                      name: My Campaign
                      audience:
                        id: 64f1c20b8a5d7e1234567890
                        name: "Tests #1"
                        size: 120
                      enrich: false
                      autoRescheduleOutOfOffice: true
                      hubspot: false
                      pipedrive: false
                      skipAlreadyContacted: false
                      status: PAUSED
                      ignoreEmojiOnlyReply: false
                ignoreEmojiOnlyRepliesCampaignPaused:
                  summary: Ignore emoji-only replies (campaign paused)
                  value:
                    statusCode: 200
                    data:
                      id: 34b5349b5490f3dec0b32043
                      name: My Campaign
                      audience:
                        id: 64f1c20b8a5d7e1234567890
                        name: "Tests #1"
                        size: 120
                      enrich: false
                      autoRescheduleOutOfOffice: true
                      hubspot: false
                      pipedrive: false
                      skipAlreadyContacted: true
                      status: PAUSED
                      ignoreEmojiOnlyReply: true
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      audience:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type: string
                          size:
                            type: integer
                      enrich:
                        type: boolean
                      autoRescheduleOutOfOffice:
                        type: boolean
                      hubspot:
                        type: boolean
                      pipedrive:
                        type: boolean
                      skipAlreadyContacted:
                        type: boolean
                      status:
                        type: string
                      ignoreEmojiOnlyReply:
                        type: boolean
        "400":
          description: Bad Request
          content:
            application/json:
              examples:
                noSettingProvided:
                  summary: No setting provided
                  value:
                    error: '"value" must contain at least one of [name, audienceId, enrich, autoRescheduleOutOfOffice, hubspot, pipedrive, skipAlreadyContacted, ignoreEmojiOnlyReply]'
                cRMSyncNotIncludedInYourPlan:
                  summary: CRM sync not included in your plan
                  value:
                    error: Please upgrade to sync your campaign with your CRM
              schema:
                type: object
                properties:
                  error:
                    type: string
        "403":
          description: Forbidden
          content:
            application/json:
              examples:
                campaignNameAlreadyUsed:
                  summary: Campaign name already used
                  value:
                    error: Campaign name already used
                audienceCanNotBeChangedOnceTheCampaignIsStarted:
                  summary: Audience can not be changed once the campaign is started
                  value:
                    error: Once started, you can not change the audience of a campaign
                cRMSettingsCanNotBeChangedOnARunningCampaign:
                  summary: CRM settings can not be changed on a running campaign
                  value:
                    error: Please pause the campaign to change crm settings
                ignoreEmojiOnlyRepliesCanNotBeChangedOnARunningCampaign:
                  summary: Ignore emoji-only replies can not be changed on a running campaign
                  value:
                    error: Please pause the campaign to change the ignore emoji-only reply setting
              schema:
                type: object
                properties:
                  error:
                    type: string
        "404":
          description: Not Found
          content:
            application/json:
              examples:
                campaignNotFound:
                  summary: Campaign not found
                  value:
                    error: Campaign not found
              schema:
                type: object
                properties:
                  error:
                    type: string
  /campaigns/{campaignId}/status:
    post:
      tags:
        - Campaigns
      summary: Update Campaign Status
      operationId: updateCampaignStatus
      description: |-
        ## Use this endpoint to pause or resume one campaign

        Send the target `status`:

        *   `PAUSED`: pauses the campaign. Only a `RUNNING` campaign can be paused. Scheduled actions of the campaign leads are put on hold.
        *   `RUNNING`: resumes the campaign. Only a `PAUSED` campaign can be resumed. Actions of the campaign leads are scheduled again. The same plan rules as in the app apply (running campaigns limit, identity subscription, CRM / custom campaign / A/B testing permissions).

        This endpoint does not launch a campaign for the first time: a `READY` campaign must be launched from the LGM app.

        The call is not idempotent: pausing an already paused campaign, or resuming an already running campaign, returns a `400` error and nothing is changed.

        Pausing a campaign synced with your CRM can take a few seconds (one timeline event is created per lead already contacted). If your client times out, check the campaign status with _Get Campaign_ instead of retrying.

        The response returns the id, name and new status of the campaign.
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
          description: Campaign ID
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                pauseARunningCampaign:
                  summary: Pause a running campaign
                  value:
                    statusCode: 200
                    data:
                      id: 34b5349b5490f3dec0b32043
                      name: My Campaign
                      status: PAUSED
                resumeAPausedCampaign:
                  summary: Resume a paused campaign
                  value:
                    statusCode: 200
                    data:
                      id: 34b5349b5490f3dec0b32043
                      name: My Campaign
                      status: RUNNING
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      status:
                        type: string
        "400":
          description: Bad Request
          content:
            application/json:
              examples:
                campaignIsNotRunningPauseRefused:
                  summary: Campaign is not running (pause refused)
                  value:
                    error: Only a running campaign can be paused
                campaignIsNotPausedResumeRefused:
                  summary: Campaign is not paused (resume refused)
                  value:
                    error: Only a paused campaign can be resumed
                invalidStatus:
                  summary: Invalid status
                  value:
                    error: '"status" must be one of [PAUSED, RUNNING]'
                runningCampaignsLimitReached:
                  summary: Running campaigns limit reached
                  value:
                    error: Please upgrade to have more campaigns running
                campaignHasNoAudienceResumeRefused:
                  summary: Campaign has no audience (resume refused)
                  value:
                    error: Please select an audience to launch this campaign
              schema:
                type: object
                properties:
                  error:
                    type: string
        "404":
          description: Not Found
          content:
            application/json:
              examples:
                campaignNotFound:
                  summary: Campaign not found
                  value:
                    error: Campaign not found in the current workspace. If you manage several workspaces, it may belong to another one — retry with the target workspaceId (see list_workspaces).
              schema:
                type: object
                properties:
                  error:
                    type: string
  /audiences:
    get:
      tags:
        - Audiences
      summary: List audiences
      operationId: listAudiences
      description: |-
        ### List Audiences

        Returns all audiences of the authenticated account.

        No parameter needed. The response contains an array of audiences with `id`, `name`, `leadsCount`, etc.
      responses:
        "200":
          description: Success
          content:
            application/json:
              examples:
                success:
                  summary: Success
                  value:
                    audiences:
                      - id: 66f1c20b8a5d7e1234567890
                        name: My audience
                        leadsCount: 42
              schema:
                type: object
                properties:
                  audiences:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        leadsCount:
                          type: integer
    post:
      tags:
        - Audiences
      summary: Create audience from linkedin url
      operationId: createAudienceFromLinkedinUrl
      description: |-
        Import leads into your LGM audiences by providing a LinkedIn Regular search URL, a Sales Navigator search URL, or a LinkedIn post URL. You must also provide the identity to impersonate for the search query and specify the name of the audience to populate.

        More information: [https://www.youtube.com/watch?v=nt54qlEbZJM](https://www.youtube.com/watch?v=nt54qlEbZJM)
      responses:
        "200":
          description: Success
          content:
            application/json:
              examples:
                fromLinkedinSearchUrl:
                  summary: From linkedin search url
                  value:
                    statusCode: 200
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
        "404":
          description: Not Found
          content:
            application/json:
              examples:
                whenIdentityIsNotConnectedOrWidgetIsNotOpen:
                  summary: When Identity is not connected or widget is not open
                  value:
                    error: Please verify your identity. Linkedin must be connected and widget need to be open.
              schema:
                type: object
                properties:
                  error:
                    type: string
  /audiences/{audienceId}/detail:
    get:
      tags:
        - Audiences
      summary: Get Audience Detail
      operationId: getAudienceDetail
      description: |-
        Returns detailed information about a specific audience.

        **Path Parameters:**

        *   `audienceId` (required) — MongoDB ObjectId (24-char hex string)

        **Response fields:**

        *   `id` — Audience ID
        *   `name` — Audience name
        *   `description` — Audience description
        *   `size` — Number of leads in the audience
        *   `type` — Audience type
        *   `createdAt` — ISO 8601 creation date
        *   `modifiedAt` — ISO 8601 last modification date
        *   `importStatus` — Current import status
      parameters:
        - name: audienceId
          in: path
          required: true
          schema:
            type: string
          description: (Required) The audience ID (24-char hex ObjectId)
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                success:
                  summary: Success
                  value:
                    statusCode: 200
                    data:
                      id: 60d5ec49f1a2c80015a1b2c3
                      name: Tech CTOs France
                      description: CTOs from French tech companies
                      size: 450
                      type: CUSTOM
                      createdAt: 2026-01-15T10:30:00.000Z
                      modifiedAt: 2026-03-20T14:22:00.000Z
                      importStatus: DONE
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      description:
                        type: string
                      size:
                        type: integer
                      type:
                        type: string
                      createdAt:
                        type: string
                      modifiedAt:
                        type: string
                      importStatus:
                        type: string
  /audiences/{audienceId}/leads:
    get:
      tags:
        - Audiences
      summary: Get Audience Leads
      operationId: getAudienceLeads
      description: |-
        Returns a paginated list of leads belonging to a specific audience, with the full lead record.

        ## Path Parameters

        Parameter

        Required

        Description

        `audienceId`

        ✅

        MongoDB ObjectId (24-char hex string)

        ## Query Parameters

        Parameter

        Required

        Description

        `skip`

        —

        Pagination offset. Default: `0`

        `limit`

        —

        Number of results per page. Min: `1`, Max: `100`, Default: `25`

        ## Response fields (per lead)

        Field

        Description

        `id`

        Lead ID

        `firstname` / `lastname`

        Lead name

        `companyName`

        Company name

        `companyUrl`

        Company website

        `jobTitle`

        Job title

        `location`

        Location

        `industry`

        Industry

        `shortBio`

        LinkedIn headline / short bio

        `gender`

        `"man"`, `"woman"`, or `""` when unknown

        `linkedinUrl`

        LinkedIn profile URL

        `twitter`

        Twitter handle

        `relationsCount`

        Number of LinkedIn relations, `null` when unknown

        `proEmail`

        Professional email

        `persoEmail`

        Personal email

        `phone`

        Phone number

        `emailStatus`

        Deliverability of `proEmail`: `"Valid"`, `"Risky"`, or `null` when `proEmail` was not enriched

        `emailFoundBy`

        Enrichment provider that found `proEmail`, `null` when not enriched

        `enrichStatus`

        `"Done"`, `"Not enriched"`, or `"Not enough credit"`

        `signal`

        Signal(s) the lead was imported from, comma-separated; `""` for a regular import

        `crm_id`

        Contact ID in the connected CRM (HubSpot or Pipedrive), `""` when not synced

        `audiences`

        Names of every audience the lead belongs to

        `status`

        Lead status in campaign: `STARTED`, `READY`, `PAUSED`, `STOPPED`, `COMPLETED`, `CONVERTED`, `UNSUBSCRIBED`, `SUBSCRIBED`, `NOT_PAUSED`, or `"unknown"` when the lead is in no campaign

        `customAttribute1` … `customAttribute20`

        Custom attributes, `""` when not set

        Every field is always present in the response. Values depend on the lead's enrichment level: a lead that was never enriched returns empty strings (and `null` for `relationsCount`, `emailStatus`, `emailFoundBy`). The example response is truncated to `customAttribute1`–`customAttribute3` for readability; all 20 are always returned.
      parameters:
        - name: audienceId
          in: path
          required: true
          schema:
            type: string
          description: (Required) The audience ID (24-char hex ObjectId)
        - name: skip
          in: query
          required: false
          schema:
            type: string
          description: "(Optional) Number of leads to skip. Default: 0"
        - name: limit
          in: query
          required: false
          schema:
            type: string
          description: "(Optional) Max leads to return. Min: 1, Max: 100, Default: 25"
      responses:
        "200":
          description: OK
  /audiences/create:
    post:
      tags:
        - Audiences
      summary: Create Audience
      operationId: createAudience
      description: |-
        ### Create an Audience

        Creates an empty audience.

        * * *

        ### Body

        *   `name` (string, 1-100, **required**) — audience name.

        To create an audience from a LinkedIn URL (search or post), use `POST /flow/audiences` instead.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
            example:
              name: My new audience
      responses:
        "200":
          description: Success
          content:
            application/json:
              examples:
                success:
                  summary: Success
                  value:
                    id: 66f1c20b8a5d7e1234567890
                    name: My new audience
              schema:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
  /identities:
    get:
      tags:
        - Identities
      summary: List identities
      operationId: listIdentities
      responses:
        "200":
          description: Succès
  /leads/search:
    get:
      tags:
        - Leads
      summary: Search Lead
      operationId: searchLead
      description: |-
        ### Search Lead

        Searches for one or more leads in the authenticated account.

        * * *

        ### Query params — at least one criterion required

        *   `leadId` — direct lookup by id
            
        *   `linkedinUrl` / `linkedinId` / `linkedinPublicId` — structured LinkedIn lookup (highest priority)
            
        *   `email` — lookup by email (pro or perso)
            
        *   `firstname` + `lastname` (+ `companyName` or `companyUrl` to narrow down)
            
        *   `crmId` — direct lookup by external CRM id
            

        ### Matching priority

        1.  `leadId`
            
        2.  `crm_id`
            
        3.  LinkedIn (id > publicId > url)
            
        4.  email
            
        5.  firstname + lastname + company
            

        ### Response

        *   `leads[]` — matched leads (including `involvedCampaigns` tags when the lead was removed from an audience)
            
        *   `tooManyResults: true` when too many matches are found — refine the search.
      parameters:
        - name: leadId
          in: query
          required: false
          schema:
            type: string
          description: (Optional) lead id (24 chars)
        - name: firstname
          in: query
          required: false
          schema:
            type: string
          description: (Optional) lead firstname
        - name: lastname
          in: query
          required: false
          schema:
            type: string
          description: (Optional) lead lastname
        - name: companyName
          in: query
          required: false
          schema:
            type: string
          description: (Optional) lead company name
        - name: companyUrl
          in: query
          required: false
          schema:
            type: string
          description: (Optional) lead company URL
        - name: linkedinUrl
          in: query
          required: false
          schema:
            type: string
          description: (Optional) lead LinkedIn URL
        - name: linkedinId
          in: query
          required: false
          schema:
            type: string
          description: (Optional) lead LinkedIn numeric id
        - name: linkedinPublicId
          in: query
          required: false
          schema:
            type: string
          description: (Optional) lead LinkedIn public id (slug)
        - name: email
          in: query
          required: false
          schema:
            type: string
          description: (Optional) lead email (pro or perso)
        - name: location
          in: query
          required: false
          schema:
            type: string
          description: (Optional) lead location
        - name: industry
          in: query
          required: false
          schema:
            type: string
          description: (Optional) lead industry
        - name: crmId
          in: query
          required: false
          schema:
            type: string
          description: (Optional) crm id
      responses:
        "200":
          description: Succès
  /leads:
    post:
      tags:
        - Leads
      summary: Create or Update a Lead
      operationId: createOrUpdateALead
      description: |-
        ### Create or Update a Lead

        Creates a lead (or updates it when it already exists).

        * * *

        ### Body

        *   `audience` (string, optional) — name of the target audience. If omitted, the lead is created with no audience.
            
        *   At least one of the following identifiers is required: `leadId`, `proEmail`, `persoEmail`, `linkedinUrl`, `twitter`, OR `firstname` + `lastname` (+ `companyName` or `companyUrl`).
            

        ### Profile fields (all optional, max 255 unless specified)

        `firstname`, `lastname`, `gender` (`man`|`woman`), `bio`, `companyName`, `companyUrl`, `jobTitle`, `profilePicture`, `linkedinUrl`, `twitter`, `proEmail`, `persoEmail`, `industry`, `phone`, `crm_id`, `location`, `relationsCount` (number), `leadId`.

        ### Custom fields

        `customAttribute1`…`customAttribute10` (string, max 1000).

        ### Note

        `note` (string, max 1500) — free-text note displayed on the lead profile. Providing it replaces the existing note; omitting it keeps it.

        ### Options

        *   `excludeContactedLeads` (boolean, default `false`) — when `true`, skip leads already contacted.
            
        *   `enrichData` (object) — enrichment data already available on the caller side.
            
        *   `enrichStatus` (string).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                audience:
                  type: string
                firstname:
                  type: string
                lastname:
                  type: string
                proEmail:
                  type: string
                companyName:
                  type: string
            example:
              audience: My audience
              firstname: John
              lastname: Doe
              proEmail: john@acme.com
              companyName: Acme
      responses:
        "200":
          description: Succès
  /leads/status:
    post:
      tags:
        - Leads
      summary: Update lead Status
      operationId: updateLeadStatus
      description: |-
        Use this endpoint for updating lead status in campaign.

        You need to specify at least one Lead field (persoEmail, proEmail, linkedin url, crm id) or Firstname + Lastname + (CompanyUrl or CompanyName) or you can specify its ID in the body with the param leadId

        More information: [https://www.youtube.com/watch?v=s4jevOQR4aY](https://www.youtube.com/watch?v=s4jevOQR4aY)
      responses:
        "200":
          description: Success
          content:
            application/json:
              examples:
                successUpdateLeadStatus:
                  summary: Success update lead status
                  value:
                    statusCode: 200
                    logs:
                      - campaign: myCampaign
                        leadUpdated: true
                        leadStatus: PAUSED
                unsubscribeALead:
                  summary: Unsubscribe a lead
                  value:
                    statusCode: 200
                    logs:
                      - campaign: myCampaign
                        leadUpdated: true
                        leadStatus: UNSUBSCRIBED
                resubscribeALead:
                  summary: Resubscribe a lead
                  value:
                    statusCode: 200
                    logs:
                      - campaign: myCampaign
                        leadUpdated: true
                        leadStatus: SUBSCRIBED
                leadAlreadyUpdated:
                  summary: Lead already updated
                  value:
                    statusCode: 200
                    logs:
                      - campaign: myCampaign
                        leadUpdated: false
                        reason: Lead is already CONVERTED
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  logs:
                    type: array
                    items:
                      type: object
                      properties:
                        campaign:
                          type: string
                        leadUpdated:
                          type: boolean
                        leadStatus:
                          type: string
        "404":
          description: Not Found
          content:
            application/json:
              examples:
                leadNotFound:
                  summary: Lead not found
                  value:
                    error: Lead not found
                campaignNotFound:
                  summary: Campaign not found
                  value:
                    error: Campaign myCampaign not found
              schema:
                type: object
                properties:
                  error:
                    type: string
  /leads/removefromaudience:
    post:
      tags:
        - Leads
      summary: Remove lead from audiences
      operationId: removeLeadFromAudiences
      description: |-
        ### Remove Lead from Audiences

        Removes a lead from one or more audiences.

        * * *

        ### Body

        *   `audience` (string `"all"` or array of audience names, **required**)
        *   At least one lead identifier: `crm_id`, `firstname`+`lastname` (+ `companyName`/`companyUrl`), `proEmail`, `persoEmail`, `linkedinUrl`, `twitter`

        If the lead is not present in the audience, the operation is silently ignored (no 404 returned).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                audience:
                  type: array
                  items:
                    type: string
                proEmail:
                  type: string
            example:
              audience:
                - My audience
              proEmail: john@acme.com
      responses:
        "200":
          description: Succès
  /leads/{leadId}/logs:
    get:
      tags:
        - Leads
      summary: Get Lead Logs
      operationId: getLeadLogs
      description: |-
        Returns a paginated list of activity logs for a specific lead.

        **Path Parameters:**

        *   `leadId` (required) — MongoDB ObjectId (24-char hex string)

        **Query Parameters:**

        *   `identityId` (optional) — Filter by identity. MongoDB ObjectId
        *   `skip` (optional) — Pagination offset. Default: `0`
        *   `limit` (optional) — Number of results per page. Min: `1`, Max: `100`, Default: `25`

        **Response fields (per log):**

        *   `id` — Log ID
        *   `type` — Log type
        *   `status` — Log status (SUCCESS, FAILED, etc.)
        *   `channel` — Channel (EMAIL, LINKEDIN, etc.)
        *   `message` — Log message content
        *   `createdAt` — ISO 8601 timestamp
        *   `campaignId` — Associated campaign ID
        *   `stepId` — Associated step ID
        *   `templateId` — Associated template ID
        *   `reply` — Whether this log is a reply
      parameters:
        - name: leadId
          in: path
          required: true
          schema:
            type: string
          description: (Required) The lead ID (24-char hex ObjectId)
        - name: identityId
          in: query
          required: false
          schema:
            type: string
          description: (Optional) Filter logs by identity ID (24-char hex ObjectId)
        - name: skip
          in: query
          required: false
          schema:
            type: string
          description: "(Optional) Number of logs to skip. Default: 0"
        - name: limit
          in: query
          required: false
          schema:
            type: string
          description: "(Optional) Max logs to return. Min: 1, Max: 100, Default: 25"
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                success:
                  summary: Success
                  value:
                    statusCode: 200
                    data:
                      - id: 63a1b2c3d4e5f60012345678
                        type: MESSAGE_SENT
                        status: SUCCESS
                        channel: EMAIL
                        message: Email sent successfully
                        createdAt: 2026-03-18T09:15:00.000Z
                        campaignId: 60d5ec49f1a2c80015a1b2c3
                        stepId: 60d5ec49f1a2c80015a1b2c4
                        templateId: 62f1a2b3c4d5e60078901234
                        reply: false
                      - id: 63a1b2c3d4e5f60012345679
                        type: MESSAGE_RECEIVED
                        status: SUCCESS
                        channel: LINKEDIN
                        message: Lead replied on LinkedIn
                        createdAt: 2026-03-19T14:30:00.000Z
                        campaignId: 60d5ec49f1a2c80015a1b2c3
                        stepId: 60d5ec49f1a2c80015a1b2c5
                        templateId: 62f1a2b3c4d5e60078901235
                        reply: true
                    total: 12
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        status:
                          type: string
                        channel:
                          type: string
                        message:
                          type: string
                        createdAt:
                          type: string
                        campaignId:
                          type: string
                        stepId:
                          type: string
                        templateId:
                          type: string
                        reply:
                          type: boolean
                  total:
                    type: integer
  /leads/{leadId}/conversations:
    get:
      tags:
        - Leads
      summary: Get Lead Conversations
      operationId: getLeadConversations
      description: |-
        Returns all conversations associated with a specific lead.

        **Path Parameters:**

        *   `leadId` (required) — MongoDB ObjectId (24-char hex string)

        **Query Parameters:**

        *   `identityId` (optional) — Filter by identity. MongoDB ObjectId

        **Response fields (per conversation):**

        *   `id` — Conversation ID
        *   `identityId` — Identity ID that owns the conversation
        *   `status` — Conversation status
        *   `lastMessageAt` — ISO 8601 timestamp of last message
        *   `lastMessagePreview` — Preview of the last message
        *   `leadReplied` — Whether the lead has replied
        *   `channel` — Conversation channel (EMAIL, LINKEDIN, etc.)
      parameters:
        - name: leadId
          in: path
          required: true
          schema:
            type: string
          description: (Required) The lead ID (24-char hex ObjectId)
        - name: identityId
          in: query
          required: false
          schema:
            type: string
          description: (Optional) Filter conversations by identity ID (24-char hex ObjectId)
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                success:
                  summary: Success
                  value:
                    statusCode: 200
                    data:
                      - id: 64b1c2d3e4f5a60098765432
                        identityId: 60a1b2c3d4e5f60012345678
                        status: ACTIVE
                        lastMessageAt: 2026-03-20T16:45:00.000Z
                        lastMessagePreview: Thanks for reaching out, I'd love to discuss...
                        leadReplied: true
                        channel: LINKEDIN
                      - id: 64b1c2d3e4f5a60098765433
                        identityId: 60a1b2c3d4e5f60012345678
                        status: ACTIVE
                        lastMessageAt: 2026-03-18T11:20:00.000Z
                        lastMessagePreview: Hi Jean, I noticed your work at Acme Corp...
                        leadReplied: false
                        channel: EMAIL
                    total: 2
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        identityId:
                          type: string
                        status:
                          type: string
                        lastMessageAt:
                          type: string
                        lastMessagePreview:
                          type: string
                        leadReplied:
                          type: boolean
                        channel:
                          type: string
                  total:
                    type: integer
  /leads/enrich:
    post:
      tags:
        - Leads
      summary: Enrich Lead
      operationId: enrichLead
      description: |-
        ### Enrich a Lead

        Starts an enrichment request for a lead. Depending on `enrichType`, it returns pro emails, LinkedIn profile fields, or both.

        * * *

        ### Body — at least one identifier required

        *   `leadId` (string, 24 chars) — id of an existing lead
            
        *   OR `firstname` + `lastname` (+ `companyName` / `companyUrl` / `linkedinUrl` to improve matching)
            

        ### Optional fields

        *   `linkedinUrl` (string, max 500)
            
        *   `companyName`, `companyUrl` (string)
            
        *   `mode` — `polling` (default) | `sync` | `webhook`
            
        *   `webhookUrl` (https) — **required** when `mode=webhook`
            
        *   `enrichType` — `EMAIL_ENRICH` (default) | `LINKEDIN_ENRICH` | `FULL_ENRICH`
            

        ### enrichType

        Drives what we enrich and how much it costs.

        Value

        What it does

        Credits

        Requires `leadId`

        `EMAIL_ENRICH` _(default)_

        Finds pro email + email status

        5

        No — can work agnostically from `firstname` + `lastname` + company

        `LINKEDIN_ENRICH`

        Enriches LinkedIn profile fields on the lead (job title, company, location, etc.)

        1

        **Yes**

        `FULL_ENRICH`

        LinkedIn profile + email

        5

        **Yes**

        > Without a `leadId`, only `EMAIL_ENRICH` is supported. Calling `LINKEDIN_ENRICH` or `FULL_ENRICH` without a `leadId` returns `400`.

        ### Modes

        *   `polling` — immediate response with `enrichRequestId`. Poll `GET /flow/leads/enrich/:enrichRequestId`.
            
        *   `sync` — waits for the result (may time out on large enrichments).
            
        *   `webhook` — immediate response, the result is POSTed to `webhookUrl` once ready.
            

        ### Response shape

        *   `EMAIL_ENRICH` results include `email` + `emailStatus` once enriched.
            
        *   `LINKEDIN_ENRICH` / `FULL_ENRICH` results write the enriched fields directly on the lead (visible via the lead read endpoints). `email` / `emailStatus` are returned only when the type includes  
            email enrichment.
            

        Each enrichment consumes credits (see `GET /flow/credits`).
      responses:
        "202":
          description: Accepted
          content:
            application/json:
              examples:
                pollingEnrichStarted:
                  summary: Polling — enrich started
                  value:
                    enrichRequestId: 66f1c20b8a5d7e1234567890e91
                    status: pending
                sync:
                  summary: Sync
                  value:
                    enrichRequestId: 68da423bab2e53bff0e12479
                    status: enriched
                    email: robot@lagrowthmachine.com
                    emailStatus: VALID
                webhookEnrichStarted:
                  summary: Webhook — enrich started
                  value:
                    enrichRequestId: b7a468da423bab2e53bff0e12479e91
                    status: accepted
                webhookEnrichFinished:
                  summary: Webhook — enrich finished
                  value:
                    enrichRequestId: 68da423bab2e53bff0e12479e91
                    status: enriched
                    email: robot@lagrowthmachine.com
                    emailStatus: VALID
              schema:
                type: object
                properties:
                  enrichRequestId:
                    type: string
                  status:
                    type: string
  /leads/enrich/{enrichRequestId}:
    get:
      tags:
        - Leads
      summary: Get Enrich Result
      operationId: getEnrichResult
      description: |-
        ### Get Enrich Result

        Retrieves the result of an enrichment request previously created with `POST /flow/leads/enrich` in `polling` mode.

        * * *

        ### Path param

        *   `enrichRequestId` — id returned when the enrichment was created.

        ### Possible statuses

        `pending`, `completed`, `failed`.

        When `status=completed`, the enrichment data (emails, phone, etc.) is available in the response.
      parameters:
        - name: enrichRequestId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              examples:
                completed:
                  summary: Completed
                  value:
                    id: 66f1c20b8a5d7e1234567890
                    status: completed
                    result:
                      proEmail: john@acme.com
                      persoEmail: john@gmail.com
                      phone: "+33612345678"
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                  result:
                    type: object
                    properties:
                      proEmail:
                        type: string
                      persoEmail:
                        type: string
                      phone:
                        type: string
  /members:
    get:
      tags:
        - Members
      summary: List members
      operationId: listMembers
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                listMembers:
                  summary: List members
                  value:
                    statusCode: 200
                    members:
                      - id: 61e4bc2bfee5a67c674ca091
                        name: boris tchangang
                        label: boris tchangang
                      - id: 5f2855f32dc68a0008632e46
                        name: Cynthia Cazeres
                        label: Cynthia Tchangang
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  members:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        label:
                          type: string
  /inboxWebhooks:
    post:
      tags:
        - Inbox
      summary: Create Inbox Event Webhook
      operationId: createInboxEventWebhook
      description: |-
        ### 📬 Create an Inbox Webhook

        Use this endpoint to register a new webhook that will receive real-time inbox events (LinkedIn and Email messages).

        _Request body:_

        ```json
        {
          "url": "https://webhook.site/boris-webhook",         // required: must be a valid, accessible POST URL
          "name": "Demo webhook",                              // required: webhook identifier
          "description": "My demo webhook",                    // optional: internal description
          "campaigns": ["camp_123", "camp_456"]                // optional: array of campaign IDs to filter messages
        }

        ```

        **url** must be publicly accessible and respond to POST requests with a 200 OK.

        If **campaigns** is omitted or left empty, the webhook will receive messages from all campaigns.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                name:
                  type: string
                description:
                  type: string
                campaigns:
                  type: array
                  items:
                    type: string
            example:
              url: "{{customWebhookUrl}}"
              name: Demo webhook
              description: My demo webhook
              campaigns:
                - all
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                createInboxEventWebhook:
                  summary: Create Inbox Event Webhook
                  value:
                    id: f7e97bab-0880-4eca-b913-1e0e8a0505a1
                    url: your-webhook-url
                    key: Demo webhook
                    type: INBOX_EVENT
                    campaigns: []
                    audiences:
                      - all
                    tags: []
                    createdAt: 2025-06-26T14:01:15.155Z
              schema:
                type: object
                properties:
                  id:
                    type: string
                  url:
                    type: string
                  key:
                    type: string
                  type:
                    type: string
                  campaigns:
                    type: array
                    items: {}
                  audiences:
                    type: array
                    items:
                      type: string
                  tags:
                    type: array
                    items: {}
                  createdAt:
                    type: string
    get:
      tags:
        - Inbox
      summary: List Inbox Webhooks
      operationId: listInboxWebhooks
      description: |-
        Use this endpoint to **list all the inbox webhooks** currently configured in your workspace.  
        It returns the full list of registered webhooks along with their IDs, names, and target URLs.
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                listInboxWebhooks:
                  summary: List Inbox Webhooks
                  value:
                    - id: id1
                      url: webhook url
                      key: Test webhook pour notifications inbox 2025-04-04
                      type: INBOX_EVENT
                      campaigns:
                        - all
                      createdAt: 2025-04-04T12:44:22.988Z
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    url:
                      type: string
                    key:
                      type: string
                    type:
                      type: string
                    campaigns:
                      type: array
                      items:
                        type: string
                    createdAt:
                      type: string
  /inboxWebhooks/{webhookId}:
    delete:
      tags:
        - Inbox
      summary: Delete Inbox Webhooks
      operationId: deleteInboxWebhooks
      description: |-
        Use this endpoint to **delete an existing inbox webhook** by providing its `webhookId`.  
        Once deleted, you will no longer receive inbox events at the associated URL.
      parameters:
        - name: webhookId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Delete Inbox Webhooks
          content:
            application/json:
              examples:
                deleteInboxWebhooks:
                  summary: Delete Inbox Webhooks
                  value:
                    success: true
              schema:
                type: object
                properties:
                  success:
                    type: boolean
  /inbox/linkedin:
    post:
      tags:
        - Inbox
      summary: Send A Linkedin Message To A Lead
      operationId: sendALinkedinMessageToALead
      description: |-
        This endpoint allows you to send a **LinkedIn text or voice message** to a lead via one of your connected identities.

        You must provide either a `leadId` or a `linkedinUrl`, along with the `identityId` and the `memberId` performing the action.

        * * *

        ### Request body

        ```
        {
          "identityId": "identity_123",       // required – the identity used to send the message
          "memberId": "member_001",           // required – the member performing the action
          "leadId": "lead_456",               // optional – the lead ID to message
          "linkedinUrl": "https://...",       // optional – LinkedIn profile if leadId not provided
          "message": "Hi! Are you available to chat this week?", // required if audioUrl not provided
          "audioUrl": "https://..."           // optional – link to a voice message
        }

        ```

        ⚠️ You must provide **either** `leadId` **or** `linkedinUrl`.  
        ⚠️ You must also provide **either** a `message` or an `audioUrl`.

        ### Input Parameters

        Field

        Type

        Required

        Description

        `identityId`

        `string`

        ✅ Yes

        ID of the LinkedIn identity that will send the message.

        `memberId`

        `string`

        ✅ Yes

        ID of the member (user) performing the action. Used for attribution and permissions.

        `leadId`

        `string`

        ❌ Optional

        ID of the lead to message. Required if `linkedinUrl` is not provided.

        `linkedinUrl`

        `string`

        ❌ Optional

        LinkedIn profile URL of the lead. Required if `leadId` is not provided.

        `message`

        `string`

        ❌ Optional

        Text message to send. Required if `audioUrl` is not provided.

        `audioUrl`

        `string`

        ❌ Optional

        URL to a hosted voice message (MP3). Required if `message` is not provided.

        `attachments`

        `array`

        ❌ Optional

        List of file URLs to attach to the message.

        `source`

        `string`

        ❌ Optional

        Optional source identifier (`api`, `make`, `n8n`, `zapier`). Helps with tracking usage context.

        * * *

        ### Important rules

        *   You **must** provide at least one of: `leadId` **or** `linkedinUrl`.
            
        *   You **must** provide at least one of: `message` **or** `audioUrl`.
            
        *   `identityId` and `memberId` are **always required**.
            

        ### Notes

        *   `memberId` must be retrieved using the [Members API](#members-api).
            
        *   `identityId` must match a connected LinkedIn identity in your account.
            
        *   The system automatically looks up or matches the lead based on `leadId` or `linkedinUrl`.
            
        *   If no conversation exists with the lead and identity, the request will fail with `"Conversation not found"`.
            

        > ⚠️ **Warning: Be Responsible with Your API Usage**

        Please ensure that your scripts are properly controlled and not unintentionally looping over this endpoint.  
        Uncontrolled or excessive calls may affect your experience and platform stability.

        La Growth Machine is **not responsible for accidental or abusive usage** caused by misconfigured automations or scripts.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                sendALinkedinMessageToALead:
                  summary: Send A Linkedin Message To A Lead
                  value:
                    statusCode: 200
                    lead:
                      firstname: Tom
                      lastname: John
                      id: lead-id
                      gender: man
                      shortBio: CXO
                      lastActions:
                        last:
                          - campaignId: 5f69efcc0d10960008843c
                            type: GOOGLE_ON_REPLY
                            channel: GOOGLE
                            date: 1600850701996
                        lastStatus:
                          - campaignId: 62c2b6ad10dcf12e212320
                            status: STARTED
                            date: 1665658852691
                      companyName: Tom Agency
                      companyUrl: https://tomAgency.io
                      createdAt: 1596528516794
                      modifiedAt: 1738834739541
                      jobTitle: Product Owner
                      linkedinUrl: https://www.linkedin.com/in/link-to-linkedin-url
                      salesNavUrl: https://www.linkedin.com/sales/people/link-to-sales-nav,NAME_SEARCH
                      userId: user-id
                      twitter: twitter-if-found
                      proEmail: lead's pro email
                      audiences:
                        - 5f29173dc0efab0006e346c0
                      industry: Saas
                      phone: null
                      companyPhone: null
                      customAttribute1: null
                      customAttribute2: null
                      customAttribute3: null
                      customAttribute4: null
                      customAttribute5: null
                      customAttribute6: null
                      customAttribute7: null
                      customAttribute8: null
                      customAttribute9: null
                      customAttribute10: null
                      note: null
                      location: Paris, France
                      audiencesWithName: []
                      pausedCampaigns: []
                      involvedCampaigns:
                        - _id: 5f69efc09310993108ba4932
                          name: Test email campaign
                          status: CANCELED
                          launchedAt: 1600778222058
                          tag: TO_QUALIFY
                      involvedCampaignsLogs: []
                      hubspot: {}
                      pipedrive:
                        firstname: Tom
                        lastname: John
                        jobTitle: CXO
                        company: Tom Agency
                      lifecycle: null
                      lastMessageSentAt: 1738834709876
                      reply:
                        repliedAt: 1744129740682
                        content: Yes, ok for me
                        identityId: 5f285dd71060540008901284
                        channel: LINKEDIN
                      tags:
                        - campaignId: 632cc1501d0ece52a2d53912
                          tag: TO_QUALIFY
                          status: REPLIED
                sendALinkedinVoiceMessageToALead:
                  summary: Send A Linkedin Voice Message To A Lead
                  value:
                    statusCode: 200
                    lead:
                      firstname: Tom
                      lastname: John
                      id: lead-id
                      gender: man
                      shortBio: CXO
                      lastActions:
                        last:
                          - campaignId: 5f69efcc0d10960008843c
                            type: GOOGLE_ON_REPLY
                            channel: GOOGLE
                            date: 1600850701996
                        lastStatus:
                          - campaignId: 62c2b6ad10dcf12e212320
                            status: STARTED
                            date: 1665658852691
                      companyName: Tom Agency
                      companyUrl: https://tomAgency.io
                      createdAt: 1596528516794
                      modifiedAt: 1738834739541
                      jobTitle: Product Owner
                      linkedinUrl: https://www.linkedin.com/in/link-to-linkedin-url
                      salesNavUrl: https://www.linkedin.com/sales/people/link-to-sales-nav,NAME_SEARCH
                      userId: user-id
                      twitter: twitter-if-found
                      proEmail: lead's pro email
                      audiences:
                        - 5f29173dc0efab0006e346c0
                      industry: Saas
                      phone: null
                      companyPhone: null
                      customAttribute1: null
                      customAttribute2: null
                      customAttribute3: null
                      customAttribute4: null
                      customAttribute5: null
                      customAttribute6: null
                      customAttribute7: null
                      customAttribute8: null
                      customAttribute9: null
                      customAttribute10: null
                      note: null
                      location: Paris, France
                      audiencesWithName: []
                      pausedCampaigns: []
                      involvedCampaigns:
                        - _id: 5f69efc09310993108ba4932
                          name: Test email campaign
                          status: CANCELED
                          launchedAt: 1600778222058
                          tag: TO_QUALIFY
                      involvedCampaignsLogs: []
                      hubspot: {}
                      pipedrive:
                        firstname: Tom
                        lastname: John
                        jobTitle: CXO
                        company: Tom Agency
                      lifecycle: null
                      lastMessageSentAt: 1738834709876
                      reply:
                        repliedAt: 1744129740682
                        content: Yes, ok for me
                        identityId: 5f285dd71060540008901284
                        channel: LINKEDIN
                      tags:
                        - campaignId: 632cc1501d0ece52a2d53912
                          tag: TO_QUALIFY
                          status: REPLIED
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  lead:
                    type: object
                    properties:
                      firstname:
                        type: string
                      lastname:
                        type: string
                      id:
                        type: string
                      gender:
                        type: string
                      shortBio:
                        type: string
                      lastActions:
                        type: object
                        properties:
                          last:
                            type: array
                            items:
                              type: object
                              properties:
                                campaignId:
                                  type: string
                                type:
                                  type: string
                                channel:
                                  type: string
                                date:
                                  type: integer
                          lastStatus:
                            type: array
                            items:
                              type: object
                              properties:
                                campaignId:
                                  type: string
                                status:
                                  type: string
                                date:
                                  type: integer
                      companyName:
                        type: string
                      companyUrl:
                        type: string
                      createdAt:
                        type: integer
                      modifiedAt:
                        type: integer
                      jobTitle:
                        type: string
                      linkedinUrl:
                        type: string
                      salesNavUrl:
                        type: string
                      userId:
                        type: string
                      twitter:
                        type: string
                      proEmail:
                        type: string
                      audiences:
                        type: array
                        items:
                          type: string
                      industry:
                        type: string
                      phone: {}
                      companyPhone: {}
                      customAttribute1: {}
                      customAttribute2: {}
                      customAttribute3: {}
                      customAttribute4: {}
                      customAttribute5: {}
                      customAttribute6: {}
                      customAttribute7: {}
                      customAttribute8: {}
                      customAttribute9: {}
                      customAttribute10: {}
                      note: {}
                      location:
                        type: string
                      audiencesWithName:
                        type: array
                        items: {}
                      pausedCampaigns:
                        type: array
                        items: {}
                      involvedCampaigns:
                        type: array
                        items:
                          type: object
                          properties:
                            _id:
                              type: string
                            name:
                              type: string
                            status:
                              type: string
                            launchedAt:
                              type: integer
                            tag:
                              type: string
                      involvedCampaignsLogs:
                        type: array
                        items: {}
                      hubspot:
                        type: object
                        properties: {}
                      pipedrive:
                        type: object
                        properties:
                          firstname:
                            type: string
                          lastname:
                            type: string
                          jobTitle:
                            type: string
                          company:
                            type: string
                      lifecycle: {}
                      lastMessageSentAt:
                        type: integer
                      reply:
                        type: object
                        properties:
                          repliedAt:
                            type: integer
                          content:
                            type: string
                          identityId:
                            type: string
                          channel:
                            type: string
                      tags:
                        type: array
                        items:
                          type: object
                          properties:
                            campaignId:
                              type: string
                            tag:
                              type: string
                            status:
                              type: string
        "404":
          description: Not Found
          content:
            application/json:
              examples:
                404SendALinkedinMessageToALead:
                  summary: 404 - Send A Linkedin Message To A Lead
                  value:
                    error: Please provide a message or audioUrl
              schema:
                type: object
                properties:
                  error:
                    type: string
  /inbox/email:
    post:
      tags:
        - Inbox
      summary: Send An Email Message To A Lead
      operationId: sendAnEmailMessageToALead
      description: |-
        ## 📧 Send an Email to a Lead

        This endpoint allows you to send a custom email to a lead using one of your connected email identities.

        * * *

        Request Body

        ```json
        Request body
        {
            "message": {
                "html": "Your html email version.",
                "text": "Your text version."
            },
            "identityId": "identity_123",
            "leadId": "lead_123",
            "leadEmail": "lead@lagrowthmachine.com",
            "replyInLastThread": true,
            "replyToMessageId": "last_message_id",
            "subject": "Re: LGM has the best apis for inbox"
        }

        ```

        * * *

        ### Input Parameters

        **Field**

        **Type**

        **Required**

        **Description**

        message.html

        string

        ✅ Yes

        The HTML version of the email body.

        message.text

        string

        ✅ Yes

        plain-text version of the email body.

        identityId

        string

        ✅ Yes

        ID of the email identity that will send the message.

        leadId

        string

        ⚠️ One of leadId or leadEmail required

        ID of the target lead.

        leadEmail

        string

        ⚠️ One of leadId or leadEmail required

        Email address of the lead. Must be valid.

        replyInLastThread

        boolean

        ⚠️ One of replyInLastThread, replyToMessageId, or subject required

        Whether to reply in the last thread.

        replyToMessageId

        string

        ⚠️ Same group as above

        ID of a specific message to reply to.

        subject

        string

        ⚠️ Same group as above

        Email subject. Required if not replying.

        cc

        string

        ❌ Optional

        Comma-separated list of CC recipients.

        bcc

        string

        ❌ Optional

        Comma-separated list of BCC recipients.

        * * *

        ### Important rules

        ⚠️ You must provide at least one of leadId or leadEmail

        ⚠️ You must also provide at least one of:

        *   replyInLastThread
            
        *   replyToMessageId
            
        *   subject
            

        * * *

        ### Notes

        *   `identityId` must match a connected LinkedIn identity in your account.
            
        *   The system automatically looks up or matches the lead based on `leadId` or `linkedinUrl`.
            
        *   If no conversation exists with the lead and identity, the request will fail with `"Conversation not found"`.
            

        > ⚠️ **Warning: Be Responsible with Your API Usage**

        Please ensure that your scripts are properly controlled and not unintentionally looping over this endpoint.  
        Uncontrolled or excessive calls may affect your experience and platform stability.

        La Growth Machine is **not responsible for accidental or abusive usage** caused by misconfigured automations or scripts.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                sendAnEmailMessageToALead:
                  summary: Send An Email Message To A Lead
                  value:
                    statusCode: 200
                    lead:
                      firstname: Tom
                      lastname: John
                      id: lead-id
                      gender: man
                      shortBio: CXO
                      lastActions:
                        last:
                          - campaignId: 5f69efcc0d10960008843c
                            type: GOOGLE_ON_REPLY
                            channel: GOOGLE
                            date: 1600850701996
                        lastStatus:
                          - campaignId: 62c2b6ad10dcf12e212320
                            status: STARTED
                            date: 1665658852691
                      companyName: Tom Agency
                      companyUrl: https://tomAgency.io
                      createdAt: 1596528516794
                      modifiedAt: 1738834739541
                      jobTitle: Product Owner
                      linkedinUrl: https://www.linkedin.com/in/link-to-linkedin-url
                      salesNavUrl: https://www.linkedin.com/sales/people/link-to-sales-nav,NAME_SEARCH
                      userId: user-id
                      twitter: twitter-if-found
                      proEmail: lead's pro email
                      audiences:
                        - 5f29173dc0efab0006e346c0
                      industry: Saas
                      phone: null
                      companyPhone: null
                      customAttribute1: null
                      customAttribute2: null
                      customAttribute3: null
                      customAttribute4: null
                      customAttribute5: null
                      customAttribute6: null
                      customAttribute7: null
                      customAttribute8: null
                      customAttribute9: null
                      customAttribute10: null
                      note: null
                      location: Paris, France
                      audiencesWithName: []
                      pausedCampaigns: []
                      involvedCampaigns:
                        - _id: 5f69efc09310993108ba4932
                          name: Test email campaign
                          status: CANCELED
                          launchedAt: 1600778222058
                          tag: TO_QUALIFY
                      involvedCampaignsLogs: []
                      hubspot: {}
                      pipedrive:
                        firstname: Tom
                        lastname: John
                        jobTitle: CXO
                        company: Tom Agency
                      lifecycle: null
                      lastMessageSentAt: 1738834709876
                      reply:
                        repliedAt: 1744129740682
                        content: Yes, ok for me
                        identityId: 5f285dd71060540008901284
                        channel: LINKEDIN
                      tags:
                        - campaignId: 632cc1501d0ece52a2d53912
                          tag: TO_QUALIFY
                          status: REPLIED
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  lead:
                    type: object
                    properties:
                      firstname:
                        type: string
                      lastname:
                        type: string
                      id:
                        type: string
                      gender:
                        type: string
                      shortBio:
                        type: string
                      lastActions:
                        type: object
                        properties:
                          last:
                            type: array
                            items:
                              type: object
                              properties:
                                campaignId:
                                  type: string
                                type:
                                  type: string
                                channel:
                                  type: string
                                date:
                                  type: integer
                          lastStatus:
                            type: array
                            items:
                              type: object
                              properties:
                                campaignId:
                                  type: string
                                status:
                                  type: string
                                date:
                                  type: integer
                      companyName:
                        type: string
                      companyUrl:
                        type: string
                      createdAt:
                        type: integer
                      modifiedAt:
                        type: integer
                      jobTitle:
                        type: string
                      linkedinUrl:
                        type: string
                      salesNavUrl:
                        type: string
                      userId:
                        type: string
                      twitter:
                        type: string
                      proEmail:
                        type: string
                      audiences:
                        type: array
                        items:
                          type: string
                      industry:
                        type: string
                      phone: {}
                      companyPhone: {}
                      customAttribute1: {}
                      customAttribute2: {}
                      customAttribute3: {}
                      customAttribute4: {}
                      customAttribute5: {}
                      customAttribute6: {}
                      customAttribute7: {}
                      customAttribute8: {}
                      customAttribute9: {}
                      customAttribute10: {}
                      note: {}
                      location:
                        type: string
                      audiencesWithName:
                        type: array
                        items: {}
                      pausedCampaigns:
                        type: array
                        items: {}
                      involvedCampaigns:
                        type: array
                        items:
                          type: object
                          properties:
                            _id:
                              type: string
                            name:
                              type: string
                            status:
                              type: string
                            launchedAt:
                              type: integer
                            tag:
                              type: string
                      involvedCampaignsLogs:
                        type: array
                        items: {}
                      hubspot:
                        type: object
                        properties: {}
                      pipedrive:
                        type: object
                        properties:
                          firstname:
                            type: string
                          lastname:
                            type: string
                          jobTitle:
                            type: string
                          company:
                            type: string
                      lifecycle: {}
                      lastMessageSentAt:
                        type: integer
                      reply:
                        type: object
                        properties:
                          repliedAt:
                            type: integer
                          content:
                            type: string
                          identityId:
                            type: string
                          channel:
                            type: string
                      tags:
                        type: array
                        items:
                          type: object
                          properties:
                            campaignId:
                              type: string
                            tag:
                              type: string
                            status:
                              type: string
        "404":
          description: Failed because Identity does not exist
          content:
            application/json:
              examples:
                failedBecauseIdentityDoesNotExist:
                  summary: Failed because Identity does not exist
                  value:
                    error: Identity not found
                failedBecauseIdentityDoesNotExistCopy:
                  summary: Failed because Identity does not exist Copy
                  value:
                    error: Lead with email emailthatdoes@notexists.com not found
              schema:
                type: object
                properties:
                  error:
                    type: string
  /inbox/conversations/note:
    post:
      tags:
        - Inbox
      summary: Edit Inbox Conversation Note
      operationId: editInboxConversationNote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                editInboxConversationNote:
                  summary: Edit Inbox Conversation Note
                  value:
                    success: true
                    data:
                      conversationId: 651e981118082022cc099851
                      leadId: 650c056ca3f66db7f6b700df
                      note: |-
                        Lead phone found on Lusha
                        -- 2026-02-11 04:48 --
                        Call ASAP
                      mode: append
                      truncated: false
                      noteLength: 54
                      timestamp: 2026-02-11T04:48:37.200Z
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      conversationId:
                        type: string
                      leadId:
                        type: string
                      note:
                        type: string
                      mode:
                        type: string
                      truncated:
                        type: boolean
                      noteLength:
                        type: integer
                      timestamp:
                        type: string
  /leads/visitors/rb2b/RB2B_Website_Visitor:
    post:
      tags:
        - Website visitor
      summary: RB2B Native Webhook
      operationId: rB2BNativeWebhook
      description: |-
        Copy this URL into your RB2B dashboard (Integration > La Growth Machine).

        Each new website visitor identified by RB2B will automatically be pushed into an audience named "RB2B\_Website\_Visitor" inside your LGM account.

        **Make sure to replace YOUR\_API\_KEY with your actual API key.**

        * * *

        💡 Pro Tips  
        Want to use a different audience name?  
        Just replace "RB2B\_Website\_Visitor" in the URL with the audience name of your choice.

        Spaces in audience names should be written as-is, e.g. High Intent Visitors is valid.

        Example:

        [https://apiv2.lagrowthmachine.com/flow/leads/visitors/vector/High Intent Visitors](https://apiv2.lagrowthmachine.com/flow/leads/visitors/vector/High%20Intent%20Visitors?apikey=YOUR_API_KEY)

        * * *

        **Mapping to Lead fields**

        ```json
        {
              "LinkedIn URL": "linkedinUrl",
              "First Name": "firstname",
              "Last Name": "lastname",
              "Title": "jobTitle",
              "Company Name": "companyName",
              "Business Email": "proEmail",
              "Website": "companyUrl",
              "Industry": "industry",
              "Employee Count": "customAttribute1",
              "Estimate Revenue": "customAttribute2",
              "City": "location",
              "State": "customAttribute3",
              "Zipcode": "customAttribute4",
              "Seen At": "customAttribute5",
              "Referrer": "customAttribute6",
              "Captured URL": "customAttribute7",
              "Tags": "customAttribute8"
        }

        ```
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                LinkedIn URL:
                  type: string
                First Name:
                  type: string
                Last Name:
                  type: string
                Title:
                  type: string
                Company Name:
                  type: string
                Business Email:
                  type: string
                Website:
                  type: string
                Industry:
                  type: string
                Employee Count:
                  type: integer
                Estimate Revenue:
                  type: string
                City:
                  type: string
                State:
                  type: string
                Zipcode:
                  type: string
                Seen At:
                  type: string
                Referrer:
                  type: string
                Captured URL:
                  type: string
                Tags:
                  type: string
            example:
              LinkedIn URL: https://www.linkedin.com/in/retentionadam/
              First Name: Adam
              Last Name: Robinson
              Title: CEO @ Retention.com. We help Ecomm brands grow & monetize their first-party audience
              Company Name: Retention.com
              Business Email: adam@retention.com
              Website: https://retention.com
              Industry: Internet Technology & Services
              Employee Count: 60
              Estimate Revenue: $22M rev
              City: Austin
              State: Texas
              Zipcode: "73301"
              Seen At: 2024-01-01T12:34:56:00.00+00.00
              Referrer: https://retention.com
              Captured URL: https://rb2b.com/pricing
              Tags: Hot Pages, Hot Leads
      responses:
        "200":
          description: Succès
      security:
        - apiKeyQuery: []
  /leads/visitors/warmly/Warmly_Website_Visitors:
    post:
      tags:
        - Website visitor
      summary: Warmly Native Webhook
      operationId: warmlyNativeWebhook
      description: |-
        Copy this URL into your Warmly dashboard.

        Each new website visitor identified by Warmly will automatically be pushed into an audience named "Warmly\_Website\_Visitors" inside your LGM account.

        **Make sure to replace YOUR\_API\_KEY with your actual API key.**

        * * *

        💡 Pro Tips  
        Want to use a different audience name?  
        Just replace "Warmly\_Website\_Visitors" in the URL with the audience name of your choice.

        Spaces in audience names should be written as-is, e.g. High Intent Visitors is valid.

        Example:

        [https://apiv2.lagrowthmachine.com/flow/leads/visitors/vector/High Intent Visitors](https://apiv2.lagrowthmachine.com/flow/leads/visitors/vector/High%20Intent%20Visitors?apikey=YOUR_API_KEY)

        * * *

        **Mapping to Lead fields**

        ```json
        {
              "LinkedIn URL": "linkedinUrl",
              "Business Email": "proEmail",
              "First Name": "firstname",
              "Last Name": "lastname",
              "Title": "jobTitle",
              "City": "location",
              "State": "customAttribute3",
              "Country": "customAttribute4",
              "Company Name": "companyName",
              "Seen At": "customAttribute5",
              "Website": "companyUrl",
              "Industry": "industry",
              "Employee Count": "customAttribute1",
              "Estimate Revenue": "customAttribute2",
              "Referrer": "customAttribute6",
              "Session Identification Confidence": "customAttribute8",
              "Pages Viewed": "customAttribute7"
         }

        ```
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Succès
      security:
        - apiKeyQuery: []
  /leads/visitors/vector/Vector_Website_Visitors:
    post:
      tags:
        - Website visitor
      summary: Vector Native Webhook
      operationId: vectorNativeWebhook
      description: |-
        Copy this URL into your Vector dashboard.

        Each new website visitor identified by Vector will automatically be pushed into an audience named "Vector\_Website\_Visitors" inside your LGM account.

        **Make sure to replace YOUR\_API\_KEY with your actual API key.**

        * * *

        💡 Pro Tips  
        Want to use a different audience name?  
        Just replace "Vector\_Website\_Visitors" in the URL with the audience name of your choice.

        Spaces in audience names should be written as-is, e.g. High Intent Visitors is valid.

        Example:

        [https://apiv2.lagrowthmachine.com/flow/leads/visitors/vector/High Intent Visitors](https://apiv2.lagrowthmachine.com/flow/leads/visitors/vector/High%20Intent%20Visitors?apikey=YOUR_API_KEY)

        * * *

        **Mapping to Lead fields**

        ```json
        {
              "contact.first_name": "firstname",
              "contact.last_name": "lastname",
              "contact.email": "proEmail",
              "contact.title": "jobTitle",
              "contact.company": "companyName",
              "contact.linkedin_url": "linkedinUrl",
              "segment.id": "customAttribute1",
              "segment.name": "customAttribute2"
        }

        ```
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                event:
                  type: string
                timestamp:
                  type: string
                contact:
                  type: object
                  properties:
                    first_name:
                      type: string
                    last_name:
                      type: string
                    email:
                      type: string
                    title:
                      type: string
                    company:
                      type: string
                    linkedin_url:
                      type: string
                segment:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
            example:
              event: contact.visited
              timestamp: 2024-04-15T14:32:00Z
              contact:
                first_name: Jane
                last_name: Doe
                email: jane.doe@example.com
                title: Marketing Manager
                company: Acme Corp
                linkedin_url: https://linkedin.com/in/janedoe
              segment:
                id: "7264"
                name: High Intent - ABM Contacts
      responses:
        "200":
          description: Succès
      security:
        - apiKeyQuery: []
  /conversations/search:
    get:
      tags:
        - Conversations
      summary: Search Conversations
      operationId: searchConversations
      parameters:
        - name: q
          in: query
          required: false
          schema:
            type: string
        - name: identityIds
          in: query
          required: false
          schema:
            type: string
        - name: leadIds
          in: query
          required: false
          schema:
            type: string
        - name: audienceIds
          in: query
          required: false
          schema:
            type: string
        - name: campaignIds
          in: query
          required: false
          schema:
            type: string
        - name: status
          in: query
          required: false
          schema:
            type: string
        - name: lastMessageStatus
          in: query
          required: false
          schema:
            type: string
        - name: lastMessageType
          in: query
          required: false
          schema:
            type: string
        - name: lastMessageAtFrom
          in: query
          required: false
          schema:
            type: string
        - name: lastMessageAtTo
          in: query
          required: false
          schema:
            type: string
        - name: callCompletedAtFrom
          in: query
          required: false
          schema:
            type: string
        - name: callCompletedAtTo
          in: query
          required: false
          schema:
            type: string
        - name: leadReplied
          in: query
          required: false
          schema:
            type: string
        - name: unsubscribed
          in: query
          required: false
          schema:
            type: string
        - name: favourite
          in: query
          required: false
          schema:
            type: string
        - name: read
          in: query
          required: false
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            type: string
        - name: searchAfter
          in: query
          required: false
          schema:
            type: string
        - name: sortField
          in: query
          required: false
          schema:
            type: string
        - name: sortDirection
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                searchConversations:
                  summary: Search Conversations
                  value:
                    statusCode: 200
                    data:
                      - id: 6a0e87c9009876512c9833c6
                        leadId: 6a045f0690987654c5557
                        identityId: 670d3f770987654c8d4c
                        lastMessageAt: 1780564619929
                        lastMessageStatus: RECEIVED
                        lastMessageType: LINKEDIN
                        status: OPEN
                      - id: 6a20bccbcd4567890bab
                        leadId: 6a045f4456789094ae1a4
                        identityId: 670d3f779e098768d4c
                        lastMessageAt: 1780564320694
                        lastMessageStatus: RECEIVED
                        lastMessageType: LINKEDIN
                        status: OPEN
                      - id: 6a0b2532098763247688a
                        leadId: 6a0b007444567899291ff
                        identityId: 6405bb9a4601c45678
                        lastMessageAt: 1780563980175
                        lastMessageStatus: RECEIVED
                        lastMessageType: LINKEDIN
                        status: OPEN
                      - id: 6a213f49cd83ea94b0d463782
                        leadId: 695ab7aee567893264d42cbf
                        identityId: 679b5d98765320bdd893
                        lastMessageAt: 1780563789000
                        lastMessageStatus: RECEIVED
                        lastMessageType: EMAIL
                        status: OPEN
                      - id: 6a2133fbcd83ea94b02778321
                        leadId: 67336a2133fbcd83ea94b02778
                        identityId: 6405b6a2133fbcd83e9876542
                        lastMessageAt: 1780563759659
                        lastMessageStatus: RECEIVED
                        lastMessageType: LINKEDIN
                        status: OPEN
                    total: 120
                    hasMore: true
                    nextToken: CNfgsQYaCSEAs1238123+OWgxqITP7zYPqlLAnukgiDloMaiEz+82D6pSwJ7pI
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        leadId:
                          type: string
                        identityId:
                          type: string
                        lastMessageAt:
                          type: integer
                        lastMessageStatus:
                          type: string
                        lastMessageType:
                          type: string
                        status:
                          type: string
                  total:
                    type: integer
                  hasMore:
                    type: boolean
                  nextToken:
                    type: string
  /conversations/{conversationId}/messages:
    get:
      tags:
        - Conversations
      summary: Get Conversation Messages
      operationId: getConversationMessages
      description: |-
        Returns all messages in a specific conversation, sorted chronologically.

        **Path Parameters:**

        *   `conversationId` (required) — MongoDB ObjectId (24-char hex string)

        **Query Parameters:**

        *   `page` (optional) — Page number for pagination. Default: `0`

        **Response fields (per message):**

        *   `id` — Message ID
        *   `channel` — Message channel (EMAIL, LINKEDIN, etc.)
        *   `status` — Message status
        *   `content` — Message content
        *   `sender` — Sender identifier (email address or LinkedIn public ID)
        *   `createdAt` — ISO 8601 timestamp
        *   `direction` — `sent` or `received`
        *   `attachments` — Array of `{ name, url }` objects
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
          description: (Required) The conversation ID (24-char hex ObjectId)
        - name: page
          in: query
          required: false
          schema:
            type: string
          description: "(Optional) Page number. Default: 0"
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                success:
                  summary: Success
                  value:
                    statusCode: 200
                    data:
                      - id: 65c1d2e3f4a5b60087654321
                        channel: LINKEDIN
                        status: sent
                        content: Hi Jean, I noticed your work at Acme Corp and wanted to connect.
                        sender: marie-martin
                        createdAt: 2026-03-18T09:00:00.000Z
                        direction: sent
                        attachments: []
                      - id: 65c1d2e3f4a5b60087654322
                        channel: LINKEDIN
                        status: received
                        content: Thanks for reaching out, I'd love to discuss further!
                        sender: jean-dupont
                        createdAt: 2026-03-20T16:45:00.000Z
                        direction: received
                        attachments: []
                    total: 2
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        channel:
                          type: string
                        status:
                          type: string
                        content:
                          type: string
                        sender:
                          type: string
                        createdAt:
                          type: string
                        direction:
                          type: string
                        attachments:
                          type: array
                          items: {}
                  total:
                    type: integer
  /inbox/conversations/archive:
    post:
      tags:
        - Conversations
      summary: Archive conversation
      operationId: archiveConversation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                archiveConversation:
                  summary: Archive conversation
                  value:
                    success: true
                    data:
                      conversationId: 6a0e87c90d1d713e98c123121
                      leadId: 6a045f069dfbbe91289121
                      archived: true
                      timestamp: 2026-06-04T12:51:10.015Z
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      conversationId:
                        type: string
                      leadId:
                        type: string
                      archived:
                        type: boolean
                      timestamp:
                        type: string
  /inbox/conversations/unarchive:
    post:
      tags:
        - Conversations
      summary: Unarchive conversation
      operationId: unarchiveConversation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                unarchiveConversation:
                  summary: Unarchive conversation
                  value:
                    success: true
                    data:
                      conversationId: 6a0e87c90d1d713e98c123121
                      leadId: 6a045f069dfbbe91289121
                      archived: false
                      timestamp: 2026-06-04T12:51:10.015Z
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      conversationId:
                        type: string
                      leadId:
                        type: string
                      archived:
                        type: boolean
                      timestamp:
                        type: string
  /inbox/conversations/snooze:
    post:
      tags:
        - Conversations
      summary: Snooze conversation
      operationId: snoozeConversation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                snoozeConversation:
                  summary: Snooze conversation
                  value:
                    success: true
                    data:
                      conversationId: 6a0e87c90d1kaie998c9833c6
                      leadId: 6a045f069dfbbe982c71289
                      snoozed: true
                      snoozeUntil: 2026-06-12T09:00:00.000Z
                      timestamp: 2026-06-04T13:02:08.983Z
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      conversationId:
                        type: string
                      leadId:
                        type: string
                      snoozed:
                        type: boolean
                      snoozeUntil:
                        type: string
                      timestamp:
                        type: string
  /inbox/conversations/unsnooze:
    post:
      tags:
        - Conversations
      summary: Unsnooze conversation
      operationId: unsnoozeConversation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: OK
          content:
            application/json:
              examples:
                snoozeConversation:
                  summary: Snooze conversation
                  value:
                    success: true
                    data:
                      conversationId: 6a0e87c90d1d73e98c9833c6
                      leadId: 6a045f069dfbbe982c7c5557
                      snoozed: false
                      snoozeUntil: null
                      timestamp: 2026-06-04T13:05:32.746Z
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      conversationId:
                        type: string
                      leadId:
                        type: string
                      snoozed:
                        type: boolean
                      snoozeUntil: {}
                      timestamp:
                        type: string
  /credits:
    get:
      tags:
        - Credits
      summary: Get Credits
      operationId: getCredits
      description: |-
        ### Get Credits

        Returns the credit balance for the authenticated account.

        * * *

        ### Response

        *   `total` — total credits available.
        *   `perishable` — credits that expire soon (already included in `total`).
      responses:
        "200":
          description: Success
          content:
            application/json:
              examples:
                success:
                  summary: Success
                  value:
                    total: 1500
                    perishable: 200
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  perishable:
                    type: integer
  /crm/search:
    post:
      tags:
        - CRM
      summary: Search CRM
      operationId: searchCRM
      description: |-
        ### Search in connected CRM

        Looks up a contact in the user's connected CRM (HubSpot, Pipedrive, Salesforce…).

        * * *

        ### Body — at least one of the following is required

        *   `email` | `proEmail` | `persoEmail` (email)
        *   OR `firstname` (+ `lastname` / `companyName` / `linkedinUrl` to narrow down)

        ### Additional optional fields

        *   `lastname` (string)
        *   `companyName` (string)
        *   `linkedinUrl` (string, max 500)

        Returns the matched CRM contact with its deals, lifecycle stage and activities.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                proEmail:
                  type: string
            example:
              proEmail: john@acme.com
      responses:
        "200":
          description: Success
          content:
            application/json:
              examples:
                contactFound:
                  summary: Contact found
                  value:
                    found: true
                    contact:
                      id: hs_123456
                      firstname: John
                      lastname: Doe
                      email: john@acme.com
                      lifecycleStage: lead
                      deals: []
              schema:
                type: object
                properties:
                  found:
                    type: boolean
                  contact:
                    type: object
                    properties:
                      id:
                        type: string
                      firstname:
                        type: string
                      lastname:
                        type: string
                      email:
                        type: string
                      lifecycleStage:
                        type: string
                      deals:
                        type: array
                        items: {}
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: "Clé API dans `Authorization: Bearer YOUR_API_KEY`."
    apiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
    apiKeyQuery:
      type: apiKey
      in: query
      name: apikey
