# User onboarding

## Endpoints

### POST /onboarding/session/validate
**Validate a user's onboarding session**

After a user finishes an interactive Footprint onboarding flow through one of our SDKs, your application will be given a validation token. This API allows you to exchange that short-lived validation token for the long-lived fp_id of the user who finished the flow. This also returns some information about the flow that the user has completed.

### POST /onboarding/session
**Create an onboarding session token**

An alternative integration to passing all arguments directly into the Footprint SDK, onboarding sessions have a few additional features when you instantiate a user's onboarding session via your backend. For more information on onboarding sessions, see [here](https://docs.onefootprint.com/articles/integrate/onboarding-sessions).
  
For example, if you have already collected existing user information on your backend and don't already have an existing `fp_id` for the user, you may create an onboarding session token to bootstrap the interactive onboarding flow with the user's information that you've already collected.
  
Or, you may start an onboarding flow that is guaranteed to resolve to a specific user by providing a `user_external_id`.
  
The `token` returned from this API should be passed into the Footprint SDK.


### POST /onboarding/session/run
**Create and run an onboarding session**

Creates an onboarding session for an existing user and runs it headlessly either until completion or until additional data must be collected from the user.
  
Returns `continue_onboarding` with a `token` to pass into the Footprint SDK when the the resulting onboarding session is incomplete after running.


### POST /users/{fp_id}/kyc
**Create a headless onboarding session**

For a user whose information has already been collected, runs the verification checks of the provided playbook. This will contact the identity verification vendors configured on your playbook and issue a decision using the rules defined on your playbook.
  
The decision issued by the rules configured on your playbook will be returned inline. In rare cases where we are waiting on an asynchronous result from vendors, you will receive a status of `pending` from this API and the final decision will be delivered via webhook.


### POST /users/{fp_id}/decisions
**Create a manual decision for a user**

Creates a new manual review decision for a user, overriding any previous decision and clearing any outstanding manual review.

### GET /users/{fp_id}/decisions
**List all decisions for a user**

Returns list of decisions made for this user in timestamp descending order. Includes both automated decisions made by running rules on a playbook and manual decisions made via dashboard users.

### GET /users/{fp_id}/onboardings
**List all onboardings for a user**

Get the list of playbooks this user has onboarded onto, ordered by timestamp descending. If a user has onboarded onto one playbook multiple times, there will be multiple onboardings. Useful to find the status from onboarding onto a specific playbook.

### GET /users/{fp_id}/onboardings/{id}
**Get an onboarding for a user**

Get the latest information about an onboarding for a specific user. Supports fetching by user external id and onboarding external id

### GET /users/{fp_id}/risk_signals
**List all risk signals for a user**

This endpoint is deprecated, but will continue to be supported for current users. Please use the /users/{fp_id}/onboardings/{onboarding_id}/risk_signals endpoint instead.

### GET /users/{fp_id}/onboardings/{onboarding_id}/risk_signals
**List all risk signals for a user and onboarding**

List the risk signals for a Footprint user and onboarding

### POST /users/{fp_id}/onboardings/{id}/ai_context
**Get AI context for an onboarding**

Compose an unstructured JSON blob with context for an onboarding that can be passed into an LLM.
  
NOTE: the response of this API may change without any prior warning. Do not deserialize the response into any structured type. Footprint will only guarantee that the response will be a valid JSON object.


### POST /users/{fp_id}/onboardings/{id}/device_insights
**Get device insights for an onboarding**

Returns a list of device fingerprints, insights, and IPs for a given onboarding.

### GET /users/{fp_id}/duplicates
**List all users with duplicate attributes**

Returns list of users with duplicate attributes to the provided user. Includes tags and label values for each user that shares duplicate attributes.

### GET /users/{fp_id}/auth_events
**List the auth events for a user**

View a user's recent auth events.

### GET /users/{fp_id}/documents
**List the documents for a user**

View the documents uploaded successfully by this user, optionally for a given `onboarding_id`.

### GET /users/{fp_id}/documents/{document_id}/consent
**Get the consent agreed to by the user for a given document id.**

Retrieve the service and service improvement consent acceptance for a given document associated with an `fp_id`. Use `/users/{fp_id}/documents` to retrieve the document identifier

### GET /users/{fp_id}/liveness
**List liveness for a user**

Lists the liveness signals for the provided user. This API is deprecated in favor of the GET /users/{fp_id}/auth_events API.

### GET /users/{fp_id}/match_signals
**List match signals for a user**

Lists the match signals for the provided user. This API is deprecated.

# User onboarding

After users been created, these APIs allow you to interact with the identity verification results and trigger new identity verification sessions.