> ## 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: 52fdae6f-a6e9-462b-b528-0a7229756540
        '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.
      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
      additionalProperties: false
      required:
        - firstname
        - lastname
      properties:
        firstname:
          type: string
        lastname:
          type: string
        email:
          type: string
          format: email
        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.

````