# Get or search for lead

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /lead/get:
    get:
      summary: Get or search for lead
      deprecated: false
      description: >-
        This endpoint can also be used to search for a lead - if campaign\_id is
        left blank, all leads matching email will be returned.
      operationId: Lead_lead/get-or-search-for-lead
      tags:
        - Lead
        - Lead
      parameters:
        - name: workspace_id
          in: query
          description: Workspace ID
          required: true
          schema:
            type: string
            description: Workspace ID
            default: ''
            examples:
              - 65f3c92d3dbe5dbb35374a9a
        - name: email
          in: query
          description: ''
          required: true
          schema:
            type: string
            description: ''
            default: ''
            format: email
            examples:
              - lead@example.com
        - name: campaign_id
          in: query
          description: Campaign ID
          required: false
          schema:
            type: string
            description: Campaign ID
            default: ''
            examples:
              - 66b447598f6dd99f7f7b5c0a
        - name: skip
          in: query
          description: ''
          required: false
          schema:
            type: integer
            description: ''
            default: ''
            minimum: 0
            examples:
              - ''
        - name: limit
          in: query
          description: ''
          required: false
          schema:
            type: integer
            description: ''
            default: ''
            minimum: 1
            maximum: 100
            examples:
              - '10'
        - name: x-api-key
          in: header
          description: Your PlusVibe.ai account's API Key
          required: true
          example: ''
          schema:
            type: string
            description: Your PlusVibe.ai account's API Key
            default: ''
            examples:
              - your-api-key
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Lead ID
                    examples:
                      - 65f3c92d3dbe5dbb35374a9a
                  timestamp_created:
                    type: string
                    description: The date and time when the lead was created.
                    format: date-time
                    examples:
                      - '2024-08-14T08:45:30Z'
                  campaign:
                    type: string
                    description: The ID of the campaign that the lead is associated to.
                    examples:
                      - 65f3c92d3dbe5dbb35374a9b
                  status:
                    type: string
                    description: Current status of the lead within the campaign.
                    examples:
                      - CONTACTED
                  contact:
                    type: string
                    description: Email address of the lead.
                    format: email
                    examples:
                      - lead@example.com
                  email_opened:
                    type: boolean
                    description: >-
                      Indicates whether the lead has opened the email sent to
                      them.
                    examples:
                      - true
                  email_replied:
                    type: boolean
                    description: Indicates whether the lead has replied to the email.
                    examples:
                      - false
                  lead_data:
                    type: object
                    description: ''
                    properties:
                      organization_id:
                        type: string
                        description: The ID of the organization to which the lead belongs.
                        examples:
                          - 65f3c92d3dbe5dbb35374a9a
                      current_step:
                        type: integer
                        description: The current step in the campaign sequence.
                        format: int32
                        examples:
                          - 3
                      next_email_time:
                        type: string
                        description: >-
                          The scheduled time for the next email to be sent to
                          the lead.
                        format: date-time
                        examples:
                          - '2024-08-13T14:30:00Z'
                      email_account_id:
                        type: string
                        description: The sender email account that has contacted the lead.
                        format: email
                        examples:
                          - sender@account.com
                      label:
                        type: string
                        description: A label or tag associated with the lead.
                        examples:
                          - Interested
                      parent_camp_id:
                        type: string
                        description: >-
                          The ID of the parent campaign if the lead is part of a
                          sequence.
                        examples:
                          - 65f3c92d3dbe5dbb35374a9a
                      parent_lead_id:
                        type: string
                        description: >-
                          The ID of the parent lead if the current lead is a
                          follow-up.
                        examples:
                          - 66b447598f6dd99f7f7b5c0a
                      is_email_verified:
                        type: string
                        description: >-
                          Indicates if the lead's email has been verified
                          (Possible values: NOT_CHECKED, VALID, INVALID, RISKY).
                        examples:
                          - VALID
                      last_sent_at:
                        type: string
                        description: >-
                          The timestamp of when the last email was sent to the
                          lead.
                        format: date-time
                        examples:
                          - '2024-08-12T10:00:00Z'
                      email:
                        type: string
                        description: The email address of the lead.
                        format: email
                        examples:
                          - lead@example.com
                      first_name:
                        type: string
                        description: The first name of the lead.
                        examples:
                          - John
                      last_name:
                        type: string
                        description: The last name of the lead.
                        examples:
                          - Doe
                      address_line:
                        type: string
                        description: The street address of the lead.
                        examples:
                          - 123 Main St
                      city:
                        type: string
                        description: The city where the lead is located.
                        examples:
                          - New York
                      country:
                        type: string
                        description: The country where the lead is located.
                        examples:
                          - United States
                      country_code:
                        type: string
                        description: The ISO 3166-1 alpha-2 country code.
                        examples:
                          - US
                      phone_number:
                        type: string
                        description: The phone number of the lead.
                        examples:
                          - +1-555-555-5555
                      company_name:
                        type: string
                        description: The name of the company where the lead works.
                        examples:
                          - Acme Corp
                      company_website:
                        type: string
                        description: The website of the lead's company.
                        examples:
                          - https://www.plusvibe.ai
                      linkedin_person_url:
                        type: string
                        description: The LinkedIn profile URL of the lead.
                        examples:
                          - https://www.linkedin.com/in/johndoe
                      linkedin_company_url:
                        type: string
                        description: The LinkedIn page URL of the lead's company.
                        examples:
                          - https://www.linkedin.com/company/plusvibeai
                    x-apidog-orders:
                      - organization_id
                      - current_step
                      - next_email_time
                      - email_account_id
                      - label
                      - parent_camp_id
                      - parent_lead_id
                      - is_email_verified
                      - last_sent_at
                      - email
                      - first_name
                      - last_name
                      - address_line
                      - city
                      - country
                      - country_code
                      - phone_number
                      - company_name
                      - company_website
                      - linkedin_person_url
                      - linkedin_company_url
                  campaign_name:
                    type: string
                    description: The name of the campaign associated with this lead.
                    examples:
                      - Summer Promotion Campaign
                x-apidog-orders:
                  - id
                  - timestamp_created
                  - campaign
                  - status
                  - contact
                  - email_opened
                  - email_replied
                  - lead_data
                  - campaign_name
          headers: {}
          x-apidog-name: OK
        '400':
          description: Validation or other error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: ''
                    examples:
                      - Validation error
                  error:
                    type: string
                    description: ''
                    examples:
                      - Validation error
                x-apidog-orders:
                  - message
                  - error
          headers: {}
          x-apidog-name: Bad Request
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
          headers: {}
          x-apidog-name: Server Error
      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-17238009-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: []

```
