# Fetch workspace leads

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /lead/workspace-leads:
    get:
      summary: Fetch workspace leads
      deprecated: false
      description: >-
        Retrieve a list of leads based on specified filters like status,
        campaign, and more.
      operationId: Lead_lead/fetch-workspace-leads
      tags:
        - Lead
        - Lead
      parameters:
        - name: workspace_id
          in: query
          description: Unique identifier of the workspace.
          required: true
          schema:
            type: string
            description: Unique identifier of the workspace.
            default: ''
            examples:
              - 65099a0dd96fae8ab61130c0
        - name: campaign_id
          in: query
          description: Unique identifier of the campaign.
          required: false
          schema:
            type: string
            description: Unique identifier of the campaign.
            default: ''
            examples:
              - 66eee42f9475e631ac0d1568
        - name: status
          in: query
          description: Filter by lead status.
          required: false
          schema:
            type: string
            description: Filter by lead status.
            default: ''
            enum:
              - SKIPPED
              - COMPLETED
              - PENDING
              - NOT_CONTACTED
              - CONTACTED
              - BOUNCED
              - REPLIED
              - UNSUBSCRIBED
              - RESCHEDULED
            examples:
              - SKIPPED
        - name: label
          in: query
          description: >-
            Filter by label associated with the lead. (Uppercase with
            underscore)
          required: false
          schema:
            type: string
            description: >-
              Filter by label associated with the lead. (Uppercase with
              underscore)
            default: ''
            enum:
              - INTERESTED
              - NOT_INTERESTED
              - MY_LABEL_NAME
            examples:
              - INTERESTED
        - name: email
          in: query
          description: Filter by email address.
          required: false
          schema:
            type: string
            description: Filter by email address.
            default: ''
            examples:
              - lead@abc.com
        - name: first_name
          in: query
          description: Filter by first name.
          required: false
          schema:
            type: string
            description: Filter by first name.
            default: ''
            examples:
              - ''
        - name: last_name
          in: query
          description: Filter by last name.
          required: false
          schema:
            type: string
            description: Filter by last name.
            default: ''
            examples:
              - ''
        - name: page
          in: query
          description: The page number for paginated results.
          required: false
          schema:
            type: integer
            description: The page number for paginated results.
            default: ''
            examples:
              - '1'
        - name: limit
          in: query
          description: The number of results per page.
          required: false
          schema:
            type: integer
            description: The number of results per page.
            default: ''
            examples:
              - '10'
        - name: sort
          in: query
          description: Field to sort results by.
          required: false
          schema:
            type: string
            description: Field to sort results by.
            default: ''
            examples:
              - _id
        - name: direction
          in: query
          description: Sort direction (ascending or descending).
          required: false
          schema:
            type: string
            description: Sort direction (ascending or descending).
            default: ''
            enum:
              - asc
              - desc
            examples:
              - asc
        - name: x-api-key
          in: header
          description: |
            Your PlusVibe.ai account's API Key
          required: false
          example: ''
          schema:
            type: string
            description: |
              Your PlusVibe.ai account's API Key
            default: ''
            examples:
              - your-api-key
      responses:
        '200':
          description: A list of leads matching the filters.
          content:
            application/json:
              schema:
                type: object
                properties:
                  _id:
                    type: string
                    description: Unique identifier for the lead.
                    examples:
                      - 66eee7889475e631ac0d156c
                  organization_id:
                    type: string
                    description: Unique identifier for the organization.
                    examples:
                      - 65099a0dd96fae8ab61130bf
                  campaign_id:
                    type: string
                    description: Unique identifier for the campaign.
                    examples:
                      - 66eee42f9475e631ac0d1568
                  workspace_id:
                    type: string
                    description: Unique identifier for the workspace.
                    examples:
                      - 65099a0dd96fae8ab61130c0
                  is_completed:
                    type: integer
                    description: >-
                      Indicates if the lead's process is completed. (1 =
                      Completed)
                    examples:
                      - 1
                  current_step:
                    type: integer
                    description: Current step in the lead's workflow.
                    examples:
                      - 1
                  email_account_id:
                    type: string
                    description: Unique identifier for the associated email account.
                  created_at:
                    type: string
                    description: Timestamp when the lead was created.
                    format: date-time
                    examples:
                      - '2024-09-14T06:29:55.185Z'
                  modified_at:
                    type: string
                    description: Timestamp when the lead was last modified.
                    format: date-time
                    examples:
                      - '2024-09-14T06:29:55.185Z'
                  status:
                    type: string
                    description: Status of the lead.
                    examples:
                      - SKIPPED
                  label:
                    type: string
                    description: Label associated with the lead.
                  email_acc_name:
                    type: string
                    description: Name of the associated email account.
                  camp_name:
                    type: string
                    description: Name of the campaign the lead belongs to.
                    examples:
                      - Campaign Name Example
                  sent_step:
                    type: integer
                    description: Step when the email was sent.
                  replied_count:
                    type: integer
                    description: Number of replies received.
                  opened_count:
                    type: integer
                    description: Number of times the email was opened.
                  last_sent_at:
                    type: string
                    description: Timestamp of the last email sent.
                    format: date-time
                  is_mx:
                    type: integer
                    description: >-
                      Status of MX record check (-1 = Not Checked, 0 = Failed, 1
                      = Successful).
                    examples:
                      - -1
                  mx:
                    type: string
                    description: MX record details.
                  email:
                    type: string
                    description: Lead's email address.
                    examples:
                      - lead@abc.com
                  first_name:
                    type: string
                    description: Lead's first name.
                  last_name:
                    type: string
                    description: Lead's last name.
                  address_line:
                    type: string
                    description: Address line of the lead.
                    examples:
                      - 200 Park Ave
                  city:
                    type: string
                    description: City of the lead.
                    examples:
                      - New York
                  state:
                    type: string
                    description: State of the lead.
                  country:
                    type: string
                    description: Country of the lead.
                  country_code:
                    type: string
                    description: Country code of the lead.
                  phone_number:
                    type: string
                    description: Phone number of the lead.
                    examples:
                      - (021) 765-3710
                  job_title:
                    type: string
                    description: Job title of the lead.
                  department:
                    type: string
                    description: Department of the lead.
                  company_name:
                    type: string
                    description: Company name of the lead.
                    examples:
                      - ACME Company
                  company_website:
                    type: string
                    description: Website of the lead's company.
                    examples:
                      - https://company.com
                  industry:
                    type: string
                    description: Industry of the lead.
                  linkedin_person_url:
                    type: string
                    description: LinkedIn profile URL of the lead.
                  linkedin_company_url:
                    type: string
                    description: LinkedIn company profile URL of the lead.
                  total_steps:
                    type: integer
                    description: Total number of workflow steps for the lead.
                    examples:
                      - 4
                  bounce_msg:
                    type: string
                    description: The bounce message for Bounced lead
                x-apidog-orders:
                  - _id
                  - organization_id
                  - campaign_id
                  - workspace_id
                  - is_completed
                  - current_step
                  - email_account_id
                  - created_at
                  - modified_at
                  - status
                  - label
                  - email_acc_name
                  - camp_name
                  - sent_step
                  - replied_count
                  - opened_count
                  - last_sent_at
                  - is_mx
                  - mx
                  - email
                  - first_name
                  - last_name
                  - address_line
                  - city
                  - state
                  - country
                  - country_code
                  - phone_number
                  - job_title
                  - department
                  - company_name
                  - company_website
                  - industry
                  - linkedin_person_url
                  - linkedin_company_url
                  - total_steps
                  - bounce_msg
          headers: {}
          x-apidog-name: OK
      security:
        - ApiKeyAuth: []
          x-apidog:
            schemeGroups:
              - id: uS5KiuC4wfZHK42AzOfA_
                schemeIds:
                  - ApiKeyAuth
            required: true
            use:
              id: uS5KiuC4wfZHK42AzOfA_
            scopes:
              uS5KiuC4wfZHK42AzOfA_:
                ApiKeyAuth: []
      x-apidog-folder: Lead
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/929054/apis/api-17238012-run
components:
  schemas: {}
  securitySchemes:
    ApiKeyAuth:
      type: apikey
      in: header
      name: x-api-key
      description: |
        API key issued in the PlusVibe dashboard. The server reads it
        from the `x-api-key` header and injects it into the request as
        the `api_key` query parameter, which is why you will see
        `api_key` referenced in validation errors.
    apiKey:
      type: apikey
      in: body
      name: api_key
      description: API key passed in request body
servers:
  - url: https://api.plusvibe.ai/api/v1
    description: Prod Env
security:
  - ApiKeyAuth: []
    x-apidog:
      schemeGroups:
        - id: uS5KiuC4wfZHK42AzOfA_
          schemeIds:
            - ApiKeyAuth
      required: true
      use:
        id: uS5KiuC4wfZHK42AzOfA_
      scopes:
        uS5KiuC4wfZHK42AzOfA_:
          ApiKeyAuth: []

```
