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

# Enigma

## Enigma

Enigma retrieves identity and firmographic data for a business profile. In Workflow Builder, the visible **Enigma** block has the ID `enigma_kyb`, applies to business entities in the **Underwriting > KYB** group, and runs the `enigma_lookup` service.

Lookup depends on an Enigma ID:

1. If the application already has an Enigma ID, Lendflow sends the lookup immediately.
2. If the ID is missing, Lendflow first runs `enigma_match`.
3. Lendflow selects the highest-confidence candidate for which Enigma returned `is_matched: true`, saves its `enigma_id`, and then runs `enigma_lookup`.

The separate **Enigma** Match block (`enigma_business_match`) remains its own Workflow Builder block. You do not need to add that block solely to satisfy Lookup's automatic dependency.

<Note>
  `enigma_lookup` is not currently available as a Data Orchestration service. Run it through the Enigma Workflow Builder block or the application enrichment API.
</Note>

## Requirements

### Enigma Lookup

| Application field | Requirement | Notes |
| - | - | - |
| Enigma ID | Conditional | Required for Lookup. If it is unavailable, Lendflow runs Enigma Match first. |

### Enigma Match

| Application field | Requirement | Notes |
| - | - | - |
| Business legal name | Required | Used to identify the business. |
| Primary business contact or owner's first name | Required | Used to identify the associated person. |
| Primary business contact or owner's last name | Required | Used to identify the associated person. |
| Address line 1 | Optional | Improves matching. |
| Address line 2 | Optional | Additional address information for matching. |
| City | Optional | Improves matching. |
| State | Optional | Must be valid when provided. |
| ZIP code | Optional | Must be valid when provided. |

## Run Enigma

### Workflow Builder

1. Add **Enigma** from the **KYB** group to a business entity in the underwriting stage.
2. Publish the workflow.
3. Start the Enigma service when the application reaches that block. The block invokes `enigma_lookup`; Lendflow invokes Match first only when the application does not already have an Enigma ID.
4. Wait for the asynchronous service status to leave `Started`.

The block has no provider-specific configuration fields.

### API

1. Call [Enrich Business Credit Application](/api-reference/workflow-management/enrich-business-credit-application).
2. Set `provider` to `enigma_lookup`.
3. Optionally include `stage_id` as a valid UUID for an underwriting stage in the application's workflow. Enigma does not require an `options` object.
4. Confirm that the response contains `data.onqueue: true`. This means Lendflow queued the job; it does not mean Enigma completed the lookup.
5. Poll [Get Commercial Data](/api-reference/workflow-management/get-commercial-data) with both `services[]=enigma_lookup` and `services[]=enigma_match` if you need the lookup and any automatically generated Match record.

```json theme={"system"}
{
  "provider": "enigma_lookup",
  "stage_id": "00000000-0000-4000-8000-000000000000"
}
```

The Lendflow routes represented by those reference pages are:

| Operation | Method and route | Parameters |
| - | - | - |
| Queue Lookup | `PUT /api/applications/{application_id}/enrich` | JSON body: required `provider`; optional `stage_id`; no Enigma `options` |
| Retrieve results | `GET /api/applications/{application_id}/commercial_data` | Path: `application_id`; optional repeated query parameter `services[]` |

## What the service returns

| Result area | Lendflow response path | What it means |
| - | - | - |
| Lookup lifecycle | `data.statuses.enigma.business_lookup` | Lendflow's state or latest failure message for `enigma_lookup`. |
| Lookup provider data | `data.commercial_data.enigma.business_lookup` | Enigma ID-endpoint response stored without a Lendflow field-level transformation. |
| Match lifecycle | `data.statuses.enigma.business_match` | Present when Match was requested and included in the retrieval filter. |
| Match provider data | `data.commercial_data.enigma.business_match` | Candidate list used to choose the saved Enigma ID. |
| Match request | `data.request_data.enigma.business_match` | Business, address, and person data sent to Enigma Match. |
| Lookup request | `data.request_data.enigma.business_lookup` | Normally `null` because the lookup identifier is a URL path value, not a request body. |

The current Lendflow integration does not send an `attrs` query parameter to Enigma's ID endpoint. Therefore, do not assume that optional or premium objects such as card transaction windows, bankruptcy, verification, SBA loans, WARN notices, industries, or detailed registrations will be returned. Enigma entitlements and API evolution can also affect the provider payload.

## Sample response

This sanitized example is abbreviated from the response shape covered by Lendflow's current Enigma fixtures. Values under `commercial_data` are provider data; values under `statuses` are Lendflow lifecycle data.

```json theme={"system"}
{
  "data": {
    "statuses": {
      "enigma": {
        "business_match": "Success",
        "business_lookup": "Success"
      }
    },
    "commercial_data": {
      "enigma": {
        "business_match": {
          "businesses": [
            {
              "is_matched": true,
              "match_confidence": 0.85,
              "enigma_id": "E000example",
              "matched_fields": {
                "name": "EXAMPLE COMPANY",
                "person": "JANE DOE"
              }
            }
          ]
        },
        "business_lookup": {
          "enigma_id": "E000example",
          "business_enigma_id": "B000example",
          "aliases": ["EXAMPLE COMPANY INC"],
          "addresses": [
            {
              "street_address1": "100 EXAMPLE AVE",
              "street_address2": null,
              "city": "NEW YORK",
              "state": "NY",
              "postal_code": "10001"
            }
          ],
          "data_sources": ["Corporate Registrations"],
          "ein": [],
          "associated_people": [
            {
              "name": "JANE DOE",
              "titles": ["OFFICER"]
            }
          ],
          "registered_agents": [],
          "phone_numbers": [],
          "websites": ["https://example.com/"],
          "registrations": [
            {
              "state": "NY",
              "issue_date": "2020-04-28",
              "file_number": "EXAMPLE-001"
            }
          ],
          "corporate_structure": "CORPORATION",
          "company_description": [],
          "year_incorporated": "2020"
        }
      }
    },
    "request_data": {
      "enigma": {
        "business_lookup": null
      }
    }
  }
}
```

## Response attributes

### Match dependency

| Attribute | Type | Meaning | Possible values or units | When returned |
| - | - | - | - | - |
| `businesses` | Array of objects | Candidate profiles returned by Enigma Match. | Zero or more candidates. | When Match produced and stored a response. |
| `is_matched` | Boolean | Enigma's determination that the candidate met its matching criteria. Lendflow only considers candidates set to `true`. | `true` or `false`. | Per candidate. |
| `match_confidence` | Number | Enigma's confidence in the entity match. Lendflow chooses the highest score among candidates marked as matched. | `0` to `1`; `1` is an exact match. It is a match-confidence score, not a credit or risk score. | Per candidate. |
| `enigma_id` | String | Opaque profile identifier that Lendflow saves for Lookup. | Provider-defined ID; do not parse its prefix. | Per candidate. |
| `matched_fields` | Object | Provider values that were similar to the submitted match inputs. | May contain `name`, `person`, `address`, or `website`; only fields returned by Enigma are present. | Per candidate when available. |

### Lookup identity and firmographics

| Attribute | Type | Meaning | Possible values or units | When returned |
| - | - | - | - | - |
| `enigma_id` | String | Enigma identifier for the returned profile. | Opaque provider ID. | Expected for a successful fixture-shaped lookup. |
| `business_enigma_id` | String | Related business-level Enigma identifier. | Opaque provider ID. | When Enigma associates the looked-up profile with a business profile. |
| `aliases` | Array of strings | Other names associated with the profile. | Provider-supplied names. | When available. |
| `addresses` | Array of objects | Addresses associated with the profile. | Address components are strings; optional components can be `null`, empty, or absent. | When available. |
| `street_address1` | String | Primary street line. | Text. | Per address when available. |
| `street_address2` | String or null | Suite, floor, or other secondary line. | Text, `null`, empty, or absent. | Per address. |
| `city` | String | City for the address. | Text. | Per address when available. |
| `state` | String | State for the address. | Usually a two-letter US code in current fixtures. | Per address when available. |
| `postal_code` | String | Postal code for the address. | String; preserve leading zeros and do not treat it as a number. | Per address when available. |
| `data_sources` | Array of strings | Categories of source data supporting the profile. | Provider-defined labels, not Lendflow statuses. | When available. |
| `ein` | Array of strings | EINs associated with the profile. | Sensitive identifiers; can be an empty array. | When available and permitted by provider coverage. |
| `associated_people` | Array of objects | People associated with the business. | Each shown object has `name` and a `titles` array. | When available. |
| `registered_agents` | Array of strings | Registered-agent names associated with the business. | Can be empty. | When available. |
| `phone_numbers` | Array of strings | Phone numbers associated with the business. | Provider-formatted strings; can be empty. | When available. |
| `websites` | Array of strings | Websites associated with the profile. | URL strings; can be empty. | When available. |
| `registrations` | Array of objects | Corporate registration summaries. | The shown fixture shape contains `state`, `issue_date`, and `file_number`. | When available. |
| `issue_date` | String | Corporate registration filing date. | `YYYY-MM-DD`. | Per registration when available. |
| `file_number` | String | Filing identifier assigned by the registration authority. | String; do not treat it as numeric. | Per registration when available. |
| `corporate_structure` | String | Provider-normalized legal structure. | For example, `CORPORATION`; other provider values are possible. | When available. |
| `company_description` | Array | Provider description values in the current fixture shape. | Can be empty; no stable child schema is established by Lendflow fixtures. | When available. |
| `year_incorporated` | String | Incorporation year. | Four-digit `YYYY` string, not a full date. | When available. |

### Missing values, scores, and time windows

| Topic | Interpretation |
| - | - |
| Missing provider data | Enigma can omit a field, return `null`, or return an empty array. Treat these as unavailable data, not as a negative finding. |
| Match score | `match_confidence` ranges from `0` to `1`. No other score is guaranteed by the current Lendflow lookup request. |
| Verification score | Official Enigma legacy documentation defines `verification.score` and its component scores as `0` to `1`, but the current Lendflow fixture does not contain this object and the integration does not explicitly request it. |
| Time windows and units | No windowed metric is guaranteed by the current request. Official Enigma legacy documentation defines card-transaction stability windows as `1m`, `3m`, and `12m`, with integer day/week/month counts, `0`-to-`1` coverage ratios, and inclusive `YYYY-MM-DD` start and end dates. Do not build against those fields unless they are present in your own response and enabled for your Enigma account. |
| Dates | The registration `issue_date` shown above uses `YYYY-MM-DD`; `year_incorporated` uses `YYYY`. |

## Errors and statuses

Lendflow lifecycle statuses describe execution. They are separate from Enigma match decisions and provider data.

| Lendflow status or message | Meaning | Action |
| - | - | - |
| `Not yet started` | Lendflow has no service run for the requested service. | Start `enigma_lookup`. |
| `Started` | The asynchronous job is running. | Continue polling. |
| `Success` | Lendflow stored the provider response. | Read `data.commercial_data.enigma.business_lookup`; `Success` is not a match or risk decision. |
| `No Business found` | Automatic Match returned no candidate with `is_matched: true`. | Verify the required name and person fields and any supplied address, then rerun. |
| Provider error text | Enigma returned a non-success HTTP response. Lendflow records Enigma's `error` or `Message` value when available. | Correct the submitted data if the message is actionable; otherwise retry or contact Lendflow. |
| Validation error | A required Match input is missing, state or ZIP is invalid, the provider is not enabled, or `stage_id` is not a valid underwriting-stage UUID. | Correct the application or request before retrying. |

See [Data Provider Status Messages](/api-docs/docs/error-handling-external-data-provider-status-messages) for shared external-provider status guidance.

## FAQ

<AccordionGroup>
  <Accordion title="Do I need to run Enigma Match before Enigma Lookup?">
    Not manually. If the application has no saved Enigma ID, `enigma_lookup` runs `enigma_match` first. The dedicated Match block remains separate for workflows whose job is explicitly to review or use Match.
  </Accordion>

  <Accordion title="Can I run Enigma through Data Orchestration?">
    No. Enigma is not currently available as a Data Orchestration service. Use the Workflow Builder block or application enrichment API.
  </Accordion>

  <Accordion title="Do I need my own Enigma API key?">
    No. Lendflow supplies the Enigma API key. Your organization must have the Lendflow service enabled, and direct Lendflow API calls require your normal bearer token.
  </Accordion>

  <Accordion title="Why is business_lookup request_data null?">
    Lookup sends the saved Enigma ID in Enigma's URL path and has no JSON request body. If Match ran first, its submitted fields are stored separately under `data.request_data.enigma.business_match`.
  </Accordion>

  <Accordion title="Does Success mean Enigma verified the business?">
    No. `Success` only means Lendflow stored Enigma's response. Evaluate the returned provider fields according to your policy.
  </Accordion>

  <Accordion title="Are all Enigma attributes guaranteed?">
    No. The current integration does not send an `attrs` query parameter. Returned fields depend on the provider response and entitlements. The sample documents only fields established by current Lendflow fixtures.
  </Accordion>
</AccordionGroup>
