---
title: With search & user decisioning
slug: detected-apis/with-search-and-user-decisioning
createdAt: 2025-11-11T16:54:43.039Z
---

## Overview

Creating a profile using the data source search to select the entity, this approach allows you to leverage data sources to enrich a profile in the platform.

Using search means that sometimes a decision needs to be made on the right entity, for instance if a search returns multiple possible matches.&#x20;

This approach is perfect for companies & in some regions charities as both these types have datasources available to be searched against.

:::hint{type="warning"}
To avoid the scenario of multiple matches its best to use the company reference number as the search term, this tends to provide a 1-1 match from search results.&#x20;

Using other search terms such as name and city can result in a higher volume of 'multiple matches' that require user input to select the best match
:::

For a more complete guide to building a user flow for this use case please see the [Create an onboarding flow via API](docId:5DFPhthlvtCO_suNZgjFA) which shows all the steps that can be used&#x20;

## API Flow

- Perform a search
- Show the results back to the user to make a decision
- Create the profile

```mermaid
---
config:
  theme: redux-dark
  look: classic
---
sequenceDiagram
  participant ClientFrontend as Clients Frontend
  participant ClientBackend as Clients Backend
  participant DetectedApis as Detected APIs
    Note over ClientBackend, DetectedApis: Authorisation
  ClientBackend ->> DetectedApis: POST /oauth/token
  DetectedApis -->> ClientBackend: Auth token


  Note over ClientFrontend, DetectedApis: Perform Search
  ClientBackend ->> DetectedApis: POST /search
      DetectedApis -->> ClientFrontend: Search Results
      Note left of ClientFrontend: Show search results to user

      ClientFrontend -->> ClientBackend: User selects result from search
      ClientBackend ->> DetectedApis: POST /profiles (using lookup_id & response_id)
```

