> For the complete documentation index, see [llms.txt](https://docs.1kosmos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.1kosmos.com/integrations/identity-verification/sailpoint-identity-verification-for-workflows/sailpoint-workflows/workflow-1-enroll-a-new-identity-for-verification.md).

# Workflow 1: Enroll a New Identity for Verification

This workflow starts a verification session in 1Kosmos, creates a matching account in the source, and emails the user a link to begin verification.&#x20;

#### Steps

| # | Step                             | SailPoint Step Type |
| - | -------------------------------- | ------------------- |
| 1 | Identity Created                 | Trigger             |
| 2 | Create 1Kosmos Workflow Instance | HTTP Request        |
| 3 | Create Account                   | Create Account      |
| 4 | Send Verification Email          | Send Email          |

&#x20;

#### Identity Created&#x20;

Set the workflow trigger to Identity Created. This fires whenever a new identity is created in SailPoint from any of your sources, and makes that identity's attributes (email, first name, last name, identity ID) available to the rest of the workflow.&#x20;

#### Create 1Kosmos Workflow Instance&#x20;

Add an HTTP Request step that calls the 1Kosmos Create Workflow Instance API to start a new IDV session for the user, using the trigger data from Step 1. &#x20;

`POST https://{1kosmos_host}/workflowapi/workflow_instance/tenant/{tenant_id}/community/{community_id}/create`&#x20;

`Accept: application/json`&#x20;

`Content-Type: application/json`&#x20;

`keyId: {keyId}`&#x20;

`keySecret: {keySecret}`&#x20;

`license: {license}`&#x20;

`requestfromswagger: true` &#x20;

`{`&#x20;

&#x20;   `"data": {`&#x20;

&#x20;       `"metaData": {`&#x20;

&#x20;           `"email": "{{$.trigger.attributes.email}}",`&#x20;

&#x20;           `"firstName": "{{$.trigger.attributes.firstname}}",`&#x20;

&#x20;           `"identityId": "{{$.trigger.identity.id}}",`&#x20;

&#x20;           `"lastName": "{{$.trigger.attributes.lastname}}"`&#x20;

&#x20;       `},`&#x20;

&#x20;       `"workflowId": "{your 1Kosmos workflowId}"`&#x20;

&#x20;   `}`&#x20;

`}`&#x20;

#### Response&#x20;

`{`&#x20;

&#x20;   `"data": {`&#x20;

&#x20;       `"wfInstanceId": "wfi-abc123-def456-ghi789",`&#x20;

&#x20;       `"wfInstanceUrl": "https://{1kosmos_host}/workflow/wf_instance/wfi-abc123-def456-ghi789"`&#x20;

&#x20;   `}`&#x20;

`}`&#x20;

&#x20;

#### Create Account&#x20;

Add a Create Account step in the workflow. This will create an account in the source using the trigger data from Step 1 and the wfInstanceId returned in Step 2.&#x20;

`POST https://{tenant}.api.{domain}.com/v3/accounts`&#x20;

`Authorization: Bearer {access_token}`&#x20;

`Content-Type: application/json`&#x20;

`{`&#x20;

&#x20;   `"attributes": {`&#x20;

&#x20;       `"createDate": "{{$.now()}}",`&#x20;

&#x20;       `"email": "{{$.trigger.attributes.email}}",`&#x20;

&#x20;       `"lastName": "{{$.trigger.attributes.lastname}}",`&#x20;

&#x20;       `"firstName": "{{$.trigger.attributes.firstname}}",`&#x20;

&#x20;       `"id": "{{$.hTTPRequest.body.data.wfInstanceId}}",`&#x20;

&#x20;       `"idvStatus": "PENDING",`&#x20;

&#x20;       `"name": "{{$.trigger.attributes.email}}",`&#x20;

&#x20;       `"sourceId": "{your source ID}"`&#x20;

&#x20;   `},`&#x20;

&#x20;   `"identityId": "{{$.trigger.identity.id}}"`&#x20;

`}`&#x20;

The id value you set here becomes the account's nativeIdentity in SailPoint (SailPoint separately generates its own internal account ID). Workflow 2 uses nativeIdentity as the key to find this account again, so it must match the wfInstanceId from Step 2.&#x20;

#### Send Verification Email&#x20;

Add a Send Email step to notify the user:&#x20;

* Recipient: identity.attributes.email&#x20;
* Link: the wfInstanceUrl returned in Step 2&#x20;


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.1kosmos.com/integrations/identity-verification/sailpoint-identity-verification-for-workflows/sailpoint-workflows/workflow-1-enroll-a-new-identity-for-verification.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
