> ## Documentation Index
> Fetch the complete documentation index at: https://leonar.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced sourcing profile search

> Advanced sourcing endpoint for finding professional profiles through Leonar's
extended sourcing network. The underlying provider is abstracted by Leonar
and may evolve without affecting your integration.

The response is normalized to Leonar's sourcing profile format and does not
expose provider-specific fields.

### Credits

This endpoint is gated by **sourcing credits**, a separate balance from the
regular enrichment credits and provisioned by your Leonar account manager.

- **One sourcing credit is consumed for every profile returned** by a search.
- Requests that return zero profiles do **not** consume any credit.
- When the workspace has no remaining sourcing credits, the request returns
  `402 insufficient_credits` and no upstream search is performed.
- Each successful response includes `credits_consumed` and
  `sourcing_credits_remaining` so your integration can track usage.

### Rate limiting

Unlike other endpoints, this one is **not subject to the global per-API-key
rate limit of 2000 requests/hour**. Throughput is gated by the sourcing
credit balance and upstream availability. Standard `X-RateLimit-*` response
headers are not returned for this endpoint.

### Pagination

Pagination is page-based. Send `page: 1` for the first page, then use the
returned `next_page` value while `has_more` is `true`.

### Exact LinkedIn profile lookup

To resolve one known LinkedIn profile, send its public profile URL in
`linkedin_url`. This field must be used on its own and accepts regular
`linkedin.com/in/...` or `linkedin.com/pub/...` URLs. Sales Navigator and
Recruiter URLs are not supported. Exact lookups return at most one profile
and use the same normalized response and sourcing-credit accounting as a
regular advanced search.

### Required scope

The API key must include the `sourcing:read` scope.




## OpenAPI

````yaml /openapi.yaml post /sourcing/advanced/profiles/search
openapi: 3.0.3
info:
  title: Leonar API
  description: >
    REST API for accessing and managing workspace data in Leonar CRM.


    ## Authentication


    All API requests require a Bearer token in the Authorization header:


    ```

    Authorization: Bearer leo_xxxxx

    ```


    API keys can be created and managed in Settings > API.


    ## Rate limiting


    - **2000 requests per hour by default**, configurable per workspace and
    shared by all API keys owned by the same user

    - Rate limit headers are included in all responses


    ## Pagination


    List endpoints support pagination via `limit` and `offset` query parameters.
  version: 1.0.0
  contact:
    name: Leonar Support
    url: https://leonar.ai
    email: support@leonar.ai
servers:
  - url: https://app.leonar.app/api/v1
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Contacts
    description: Manage contacts in your workspace
  - name: Companies
    description: Manage companies and their relationships
  - name: Deals
    description: Track and manage sales deals
  - name: Deal Pipelines
    description: View deal pipeline configurations
  - name: Projects
    description: Organize recruiting projects
  - name: Pipeline Entries
    description: Manage candidates in project pipelines
  - name: Tasks
    description: Track to-dos and follow-ups
  - name: Tags
    description: Organize resources with tags
  - name: Notes
    description: Manage notes on contacts, companies, deals, and projects
  - name: Sequences
    description: Automate outreach campaigns
  - name: Conversations
    description: View conversations across channels
  - name: Messages
    description: Send messages via email, LinkedIn, or WhatsApp
  - name: Enrichment
    description: Find emails and phone numbers for contacts
  - name: Sourcing
    description: Search and import candidates
  - name: Connected Accounts
    description: View linked LinkedIn accounts
paths:
  /sourcing/advanced/profiles/search:
    post:
      tags:
        - Sourcing
      summary: Advanced sourcing profile search
      description: >
        Advanced sourcing endpoint for finding professional profiles through
        Leonar's

        extended sourcing network. The underlying provider is abstracted by
        Leonar

        and may evolve without affecting your integration.


        The response is normalized to Leonar's sourcing profile format and does
        not

        expose provider-specific fields.


        ### Credits


        This endpoint is gated by **sourcing credits**, a separate balance from
        the

        regular enrichment credits and provisioned by your Leonar account
        manager.


        - **One sourcing credit is consumed for every profile returned** by a
        search.

        - Requests that return zero profiles do **not** consume any credit.

        - When the workspace has no remaining sourcing credits, the request
        returns
          `402 insufficient_credits` and no upstream search is performed.
        - Each successful response includes `credits_consumed` and
          `sourcing_credits_remaining` so your integration can track usage.

        ### Rate limiting


        Unlike other endpoints, this one is **not subject to the global
        per-API-key

        rate limit of 2000 requests/hour**. Throughput is gated by the sourcing

        credit balance and upstream availability. Standard `X-RateLimit-*`
        response

        headers are not returned for this endpoint.


        ### Pagination


        Pagination is page-based. Send `page: 1` for the first page, then use
        the

        returned `next_page` value while `has_more` is `true`.


        ### Exact LinkedIn profile lookup


        To resolve one known LinkedIn profile, send its public profile URL in

        `linkedin_url`. This field must be used on its own and accepts regular

        `linkedin.com/in/...` or `linkedin.com/pub/...` URLs. Sales Navigator
        and

        Recruiter URLs are not supported. Exact lookups return at most one
        profile

        and use the same normalized response and sourcing-credit accounting as a

        regular advanced search.


        ### Required scope


        The API key must include the `sourcing:read` scope.
      operationId: advance-sourcing-profiles-search
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                page:
                  type: integer
                  minimum: 1
                  default: 1
                  description: Results page to return.
                name:
                  type: string
                  maxLength: 200
                  description: Full or partial profile name.
                linkedin_url:
                  type: string
                  format: uri
                  maxLength: 500
                  description: >
                    Public LinkedIn profile URL for an exact lookup. Must be
                    used

                    without any other search filter. Supports
                    `linkedin.com/in/...`

                    and `linkedin.com/pub/...` URLs only.
                job_title:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Job titles to include.
                exclude_job_titles:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Job titles to exclude.
                current_titles_only:
                  type: boolean
                  default: true
                  description: >
                    Returns profiles matching the current job title by default.

                    Set to `false` to return profiles matching current or past
                    job titles.

                    Do not combine with `match_experience`.
                include_related_job_titles:
                  type: boolean
                  description: Include related job titles when matching title filters.
                job_function:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Job functions to include.
                seniority:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Seniority levels to include.
                match_experience:
                  type: string
                  enum:
                    - current
                    - past
                    - both
                  description: >
                    Controls how title and company filters are matched against
                    profile

                    experience entries. Do not combine with
                    `current_titles_only` or

                    `company_filter`.
                skills:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Skills to include. Boolean syntax may be used in values.
                languages:
                  type: array
                  maxItems: 50
                  items:
                    type: object
                    additionalProperties: false
                    required:
                      - language
                    properties:
                      language:
                        type: string
                      proficiency:
                        type: array
                        maxItems: 20
                        items:
                          type: string
                  description: Languages to include, optionally with proficiency filters.
                education:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Schools or institutions to include.
                educations:
                  type: array
                  maxItems: 50
                  items:
                    type: object
                    additionalProperties: false
                    properties:
                      school_name:
                        type: string
                      field_of_study:
                        type: string
                      location:
                        type: string
                  description: Structured education filters.
                location:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Locations to include.
                location_radius:
                  type: integer
                  minimum: 1
                  maximum: 500
                  description: Radius around the provided locations.
                current_work_location:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Current work locations to include.
                past_work_location:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Past work locations to include.
                company:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Companies to include.
                company_filter:
                  type: string
                  enum:
                    - current
                    - past
                    - both
                  description: >
                    Controls whether company filters match current roles, past
                    roles,

                    or both. Do not combine with `match_experience`.
                current_company_only:
                  type: boolean
                  description: Restrict company matching to current companies.
                exclude_companies:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Companies to exclude.
                domain:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Company domains to include.
                industry:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Industries to include.
                company_size:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Company size buckets, e.g. `11_50`, `51_200`, `201_500`.
                keyword:
                  type: string
                  maxLength: 500
                  description: Free-text keyword or boolean keyword expression.
                years_of_experience:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Experience ranges, e.g. `2_5`, `6_10`, or `10`.
                years_in_current_role:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Current-role tenure ranges, e.g. `2_5`, `6_10`, or `10`.
                data_types:
                  type: array
                  maxItems: 3
                  items:
                    type: string
                    enum:
                      - personal_email
                      - work_email
                      - phone
                  description: Optional contact data types to retrieve with profiles.
                reveal_info:
                  type: boolean
                  description: >-
                    Whether to attempt revealing contact details on returned
                    profiles.
                detailed_experience:
                  type: boolean
                  description: Whether to request detailed experience data.
                detailed_education:
                  type: boolean
                  description: Whether to request detailed education data.
                output_fields:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  description: Optional fields to request from the sourcing network.
            example:
              job_title:
                - VP of Product
                - Head of Product
              company:
                - Stripe
                - Datadog
              location:
                - Paris, France
                - London, United Kingdom
              skills:
                - SaaS
                - Product Management
              company_filter: current
              data_types:
                - personal_email
                - work_email
              reveal_info: true
              page: 1
      responses:
        '200':
          description: >
            Normalized profile search results. The response includes profiles,

            pagination information, sourcing credits consumed by this call, and
            the

            workspace's remaining sourcing credit balance.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      profiles:
                        type: array
                        items:
                          type: object
                          properties:
                            profile_id:
                              type: string
                            first_name:
                              type: string
                              nullable: true
                            last_name:
                              type: string
                              nullable: true
                            headline:
                              type: string
                              nullable: true
                            location:
                              type: string
                              nullable: true
                            linkedin_url:
                              type: string
                              nullable: true
                            summary:
                              type: string
                              nullable: true
                            current_job:
                              type: object
                              nullable: true
                              properties:
                                title:
                                  type: string
                                  nullable: true
                                company_name:
                                  type: string
                                  nullable: true
                            experiences:
                              type: array
                              items:
                                type: object
                                properties:
                                  title:
                                    type: string
                                    nullable: true
                                  company_name:
                                    type: string
                                    nullable: true
                                  company_domain:
                                    type: string
                                    nullable: true
                                  start_date:
                                    type: string
                                    nullable: true
                                  end_date:
                                    type: string
                                    nullable: true
                                  description:
                                    type: string
                                    nullable: true
                                  is_current:
                                    type: boolean
                            educations:
                              type: array
                              items:
                                type: object
                                properties:
                                  educational_establishment:
                                    type: string
                                    nullable: true
                                  diploma:
                                    type: string
                                    nullable: true
                                  specialization:
                                    type: string
                                    nullable: true
                                  start_date:
                                    type: string
                                    nullable: true
                                  end_date:
                                    type: string
                                    nullable: true
                            skills:
                              type: array
                              items:
                                type: string
                            open_to_work:
                              type: boolean
                              nullable: true
                      total_count:
                        type: integer
                        description: >-
                          Total number of profiles matching the query across all
                          pages.
                      filtered_count:
                        type: integer
                        description: Number of profiles returned in this response.
                      next_page:
                        type: integer
                        nullable: true
                        description: >-
                          Next page to request, or `null` when there are no more
                          pages.
                      has_more:
                        type: boolean
                        description: Whether another page is available.
                      filters_too_strict:
                        type: boolean
                      credits_consumed:
                        type: integer
                        description: Sourcing credits debited by this call.
                      sourcing_credits_remaining:
                        type: integer
                        description: Remaining sourcing credit balance after this call.
                      request_id:
                        type: string
                        description: Request identifier useful for support and debugging.
                      leonar_profiles_cached:
                        type: integer
                        description: >-
                          Number of returned profiles stored in Leonar's
                          internal profile cache.
              example:
                data:
                  profiles:
                    - profile_id: jane-doe
                      first_name: Jane
                      last_name: Doe
                      headline: VP of Product at ExampleCo
                      location: Paris, France
                      linkedin_url: https://www.linkedin.com/in/jane-doe
                      summary: Product leader with B2B SaaS experience.
                      current_job:
                        title: VP of Product
                        company_name: ExampleCo
                      experiences:
                        - title: VP of Product
                          company_name: ExampleCo
                          company_domain: example.com
                          start_date: '2021'
                          end_date: null
                          description: null
                          is_current: true
                      educations:
                        - educational_establishment: HEC Paris
                          diploma: MBA
                          specialization: null
                          start_date: '2015'
                          end_date: '2017'
                      skills:
                        - SaaS
                        - Product Management
                      open_to_work: false
                  total_count: 45
                  filtered_count: 1
                  next_page: 2
                  has_more: true
                  filters_too_strict: false
                  credits_consumed: 1
                  sourcing_credits_remaining: 499
                  request_id: req_123
                  leonar_profiles_cached: 1
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientCredits'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  responses:
    ValidationError:
      description: Invalid request data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: validation_error
              message: Invalid input
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_api_key
              message: Invalid API key
    InsufficientCredits:
      description: >
        The workspace does not have enough sourcing credits to cover this
        request.

        Sourcing credits are a separate balance from enrichment credits and must
        be

        provisioned by your Leonar account manager. Each profile returned by the

        advanced sourcing endpoint consumes one sourcing credit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: insufficient_credits
              message: Insufficient sourcing credits to cover the returned profiles
              details:
                credit_type: sourcing
                available: 0
                required: 1
    Forbidden:
      description: Billing or plan restriction
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            billing_required:
              summary: No active subscription
              value:
                error:
                  code: billing_required
                  message: An active subscription is required to access the API
            plan_upgrade:
              summary: Feature not in plan
              value:
                error:
                  code: plan_upgrade_required
                  message: This feature requires a Pro plan or higher
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - invalid_api_key
                - insufficient_scope
                - rate_limit_exceeded
                - validation_error
                - not_found
                - internal_error
                - billing_required
                - plan_upgrade_required
              description: >
                Error codes:

                - `invalid_api_key` — API key is missing, malformed, or revoked

                - `insufficient_scope` — API key lacks the required scope for
                this endpoint

                - `rate_limit_exceeded` — Too many requests (2000/hour)

                - `validation_error` — Request body or parameters failed
                validation

                - `not_found` — The requested resource does not exist

                - `internal_error` — Unexpected server error

                - `billing_required` — Workspace has no active subscription

                - `plan_upgrade_required` — Current plan does not include this
                feature
            message:
              type: string
              description: Human-readable error description
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key starting with `leo_`

````