---
title: Create an onboarding flow via API
slug: detected-apis/create-an-onboarding-flow-via-api
createdAt: 2025-09-16T11:18:22.139Z
---

## Overview

Customers often need to create a profile from their own systems the following provides a guided flow to the user to create the profile that reacts based on the type of profile.

- Get a list of the available profile types from Detected
- Capture the required type and the relevant country from the customer
- If a search is available for the profile type then gather the inputs and perform the search
- If search is not available surface the required inputs to the customer
- Create the profile&#x20;

```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 ClientBackend, DetectedApis: Get Required Inputs
  ClientBackend ->> DetectedApis: GET /search/types
  DetectedApis -->> ClientFrontend: Profile Types
  Note left of ClientFrontend: Show entity types & <br/>country list to user
  ClientFrontend -->> ClientBackend: User selects country and profile type
  alt 
  Note over ClientFrontend, DetectedApis: If Search Required For Selected Type
  ClientBackend ->> DetectedApis: GET /search/types/{type}/{countryCode}
  DetectedApis -->> ClientFrontend: Required fields for search form
  Note left of ClientFrontend: Build search form <br/>for user to complete
  ClientFrontend -->> ClientBackend: User submits search form
  ClientBackend ->> DetectedApis: POST /search
      DetectedApis -->> ClientFrontend: Search Results
      Note left of ClientFrontend: Show search results to user
   alt 
         Note over ClientFrontend, DetectedApis: If user selects a match

      ClientFrontend -->> ClientBackend: User selects result from search
      ClientBackend ->> DetectedApis: POST /profiles (using lookup_id & response_id)
      Note right of DetectedApis: Profile created
      else 
          Note over ClientFrontend, DetectedApis: If no results or no match not selected
 
      ClientFrontend -->> ClientBackend: User selects no match
      ClientBackend ->> DetectedApis: GET /profile/types/{type}/{countryCode}
        DetectedApis -->> ClientFrontend: Required fields for manual create form
          Note left of ClientFrontend: Build manual create form <br/>for user to complete
        ClientFrontend -->> ClientBackend: User submits manual create form
      ClientBackend ->> DetectedApis: POST /profiles
      Note right of DetectedApis: Profile created

      end


  else
  Note over ClientFrontend, DetectedApis: If Search NOT Required For Type
 ClientBackend ->> DetectedApis: GET /profile/types/{type}/{countryCode}
        DetectedApis -->> ClientFrontend: Required fields for manual create form
          Note left of ClientFrontend: Build manual create form <br/>for user to complete
        ClientFrontend -->> ClientBackend: User submits manual create form
      ClientBackend ->> DetectedApis: POST /profiles
      Note right of DetectedApis: Profile created



  end
```

