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

# Enrich Contacts

> Start waterfall enrichment for contacts.

LoneScale will call your `webhook_url` with this payload once the job is completed.

See the [Enrichment payload](/api-reference/webhookpayload/enrichment-payload) documentation for the full webhook schema.



## OpenAPI

````yaml POST /trigger/enrich
openapi: 3.1.0
info:
  title: OpenAPI Lonescale
  description: A sample API for Lonescale
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://public-api.lonescale.com
security:
  - ApiKeyAuth: []
paths:
  /trigger/enrich:
    post:
      description: >-
        Start waterfall enrichment for contacts.


        LoneScale will call your `webhook_url` with this payload once the job is
        completed.


        See the [Enrichment
        payload](/api-reference/webhookpayload/enrichment-payload) documentation
        for the full webhook schema.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnrichmentRequest'
        required: true
      responses:
        '200':
          description: Enrichment successfully created
          content:
            application/json:
              schema:
                $ref: 60537825-c3c4-414b-8b6e-6abd073dd6cd
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Bad request
                error: Bad request
                statusCode: 400
        '401':
          description: Invalid or missing authentication credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
              example:
                message: Invalid API Key
                error: Unauthorized
                statusCode: 401
components:
  schemas:
    EnrichmentRequest:
      type: object
      additionalProperties: false
      required:
        - enrichment_type
        - contacts
        - webhook_url
      properties:
        enrichment_type:
          type: array
          description: Types of enrichment to perform.
          items:
            type: string
            enum:
              - email
              - phone
              - profile
          minItems: 1
          uniqueItems: true
        custom:
          $ref: '#/components/schemas/EnrichmentCustomOptions'
        contacts:
          type: array
          description: Contacts to enrich.
          items:
            $ref: '#/components/schemas/Contact'
          minItems: 1
        webhook_url:
          type: string
          format: uri
          description: Webhook endpoint to receive enrichment results.
        detect_job_change:
          type: boolean
          description: >-
            When `true`, the webhook response will include a `jobChangeDetected`
            field indicating whether the contact has changed company since the
            input data was provided.


            Only effective when `enrichment_type` includes `"profile"` and
            `webhook_url` is provided.
        force_refresh:
          type: boolean
          description: >-
            Opt out of the 24h enrichment cache for this call. When a contact
            was already enriched for your account within the last 24 hours, the
            cached result is returned and no credits are consumed; pass `true`
            to force a fresh enrichment instead (credits are consumed and the
            cache entry is refreshed).
        sync_to_crm:
          type: boolean
          description: >-
            Push the enriched contact into your connected CRM. Disabled by
            default: without it, this endpoint only enriches and never writes to
            your CRM.


            When `true`, the write-back uses the integration mapping configured
            for the **Chrome extension** (contact unicity criteria, create
            fields, company create fields). It can therefore **create** contacts
            and companies that did not exist, and the created records are owned
            by the CRM user linked to the API key holder.


            To push records to your CRM with a dedicated mapping and a run
            status, use `POST /trigger/crm-sync` instead.
        source:
          type: string
          enum:
            - slack
          description: >-
            Reserved for LoneScale-hosted callers (the Slack bot). Meters the
            enrichment on the API key holder's per-user Chrome quota instead of
            the organization balance, and answers 403 when that quota is
            reached. Requires `source_signature`; leave both unset for
            integrations.
        source_signature:
          type: string
          description: >-
            Signature proving `source` comes from LoneScale. Set by the
            LoneScale Slack agent; integrations never send it.
      example:
        enrichment_type:
          - email
          - phone
        contacts:
          - firstname: John
            lastname: Doe
            email: john@acme.com
            job_title: ceo
            linkedin_url: https://www.linkedin.com/in/john-doe/
            domain: acme.com
            company_name: Acmeo
            custom:
              contact_id: '44479301'
        webhook_url: https://api.example.com/webhooks/enrichment
        custom:
          provider: lonescale
          enrichment_type: email and phone
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    AuthError:
      required:
        - message
        - error
        - statusCode
      type: object
      properties:
        message:
          type: string
          example: Invalid API Key
        error:
          type: string
          example: Unauthorized
        statusCode:
          type: integer
          example: 401
    EnrichmentCustomOptions:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          description: >-
            Unique ID of the record from the CRM, database, or other source
            system.
        provider:
          type: string
          description: Downstream data provider to use (e.g., Lonescale).
        enrichment_type:
          type: string
          description: Provider-specific enrichment mode.
          example: phone
    Contact:
      type: object
      description: >-
        A contact must carry at least one identifier: `linkedin_url`, or
        `firstname` + `lastname` + (`domain` or `company_name`), or `email`
        alone. Anything else cannot be resolved and comes back with `status:
        "failed"`.
      additionalProperties: false
      properties:
        firstname:
          type: string
        lastname:
          type: string
        email:
          type: string
          format: email
          description: >-
            Known email of the contact. Also usable as a standalone identifier:
            sent alone (with `enrichment_type` including `profile`), it resolves
            the person's identity — name, LinkedIn URL, job title and company.
          example: john@acme.com
        job_title:
          type: string
        linkedin_url:
          type: string
          format: uri
        domain:
          type: string
          description: Company domain (e.g., acme.com).
        company_name:
          type: string
        custom:
          $ref: '#/components/schemas/ContactCustom'
    ContactCustom:
      type: object
      additionalProperties: true
      properties:
        contact_id:
          type: string
          description: Optional CRM record id specific to this contact.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Provide your API key in the x-api-key header.

````

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