> For the complete documentation index, see [llms.txt](https://dfend.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dfend.gitbook.io/documentation/developer-api/user-involvement.md).

# User Involvement

## Verifications

Events may include [Recommendations](/documentation/developer-api/types/event/recommendation.md) of NOTIFY\_USER\_WITH\_LINK type. This indicates that you should contact the user to close the loop on unrecognized activity.&#x20;

These types of recommendations will include a template string with pre-written messaging that you can send directly to the user. Simply replace the `{link}` substring in the template with a link to a page where you can handle the verification.

Currently, if you choose to handle verifications yourself, you will leave DFend blind about the state of locations, devices, and other verifiable data fields on an Identity. We are expanding our API to support this type of feedback, but we can also get around this issue by handling verifications for you.

### DFend verifications

Configure DFend to handle verifications by allowing your users to opt into DFend. When you enable this functionality, your Recommendations templates will come pre-populated with links to DFend co-branded verification pages. We will handle user feedback and send you related [Events](/documentation/developer-api/types/event.md).

Our verifications system is robust. It includes a mechanism for handling timeout periods and supports sending escalated events when rejected items continue to present themselves in your system.

{% hint style="info" %}
Enable in **Dashboard** under [Setup > Policies](https://dashboard.dfend.app/dashboard/setup/policies).
{% endhint %}

## Opt into DFend

To allow users to opt into DFend (and subsequently opt out, if desired) you will need to surface DFend in your UI. Use the convenience methods in our [JS SDK](/documentation/developer-api/js-sdk.md).

* Easily retrieve a user's current opt-in status with a single method call.
* Easily generate links for opt-in and opt-out pages specific to a user.

### Setup steps without the JS SDK

Find a user's current opt-in status by sending a request to our HTTPS API on the [Identity Status](/documentation/developer-api/https-api/identity-status.md) endpoint.

Next, generate the correct link.&#x20;

In your app under User Settings, surface the user's current opt-in status and add a button that sends the user to whichever page will change their current status.

#### Create an opt-in link for a user

Insert the values into the string using interpolation.

```typescript
`https://dashboard.dfend.app/opt-in/k/${publishableApiKey}/u/${userId}`
```

#### Create an opt-out link for a user

Insert the values into the string using interpolation.

```typescript
`https://dashboard.dfend.app/opt-out/k/${publishableApiKey}/u/${userId}`
```

### Related events

We will send [Events](/documentation/developer-api/types/event.md) of type USER\_OPTED\_IN and USER\_OPTED\_OUT when a user's opt-in status changes in our system. In the case where a user opts out, you can continue to send Signals with their user ID--we will not contact them until they opt back in.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dfend.gitbook.io/documentation/developer-api/user-involvement.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
