Getting started with flows

Wanting to try out Digital Identity but don’t know where to start? Fear not, here you’ll find all the information you need to get started in no time.

In order to ease the process, you can import this Postman collection:

https://www.getpostman.com/collections/1f33696fa9b4d14b10c6

Creating a flow

Once you have created an API key, you can create a Flow. Flows are a sequence of Identity Validations that will be included in your validation process. The order in which you enter them will be the order in which they appear to the user. Follow these steps to create a flow:

  1. Create a POST request to the Create Flow endpoint.
https://api.identity.truora.com/v1/flows
  1. Create a Header named Truora-API-Key and set its value to the API key you created.
  2. Create a Header named Content-Type and set its value to application/json.
  3. Set the Body to your flow in the following json format:
{
    "name": "Config Test Duran",
    "status": "enabled",
    "identity_verifications": [
        {
            "step_id": "",
            "name": "document_verification",
            "config": {
                "enable_file_upload": true,
                "enable_file_upload_on_last_retry": false,
                "retries": 2,
                "allowed_document_types": [
                    {
                        "country": "PE",
                        "document_types": [
                            "national-id"
                        ]
                    },
                    {
                        "country": "CL",
                        "document_types": [
                            "national-id"
                        ]
                    }
                ]
            },
            "steps": [
                {
                    "action_id": "IPA4988f0c22f2789927d5b08d9eca8d89d",
                    "type": "enter_document_type",
                    "verification_output": null,
                    "redirect_url": "",
                    "config": null,
                    "expected_inputs": [
                        {
                            "type": "select",
                            "value": "",
                            "name": "country",
                            "placeholder": "Ingresa el pais",
                            "description": "¿Cuál es el país de tu documento de identificación?",
                            "length": 0,
                            "read_only": false
                        },
                        {
                            "type": "select",
                            "value": "",
                            "name": "document_type",
                            "placeholder": "Selecciona el tipo de documento",
                            "description": "¿Cuál es el tipo de tu documento de identificación?",
                            "length": 0,
                            "read_only": false
                        }
                    ],
                    "files_upload_urls": null,
                    "remaining_retries": 0,
                    "async_step": false
                },
                {
                    "action_id": "IPA7d773ecdae7b71671665a682f9209e11",
                    "type": "take_document_photo",
                    "verification_output": null,
                    "redirect_url": "",
                    "config": null,
                    "expected_inputs": null,
                    "files_upload_urls": [
                        {
                            "name": "document_front",
                            "url": "",
                            "description": "Envía una foto de la parte *delantera* de tu documento de identidad: en la imagen puedes ver un ejemplo de cómo debería visualizarse.\n\n¡Busca un lugar con luz para que la información sea legible y nítida! 📸"
                        },
                        {
                            "name": "document_back",
                            "url": "",
                            "description": "Envía una foto de la parte *trasera* de tu documento de identidad: en la imagen puedes ver un ejemplo de cómo debería visualizarse.\n\n¡Busca un lugar con luz para que la información sea legible y nítida! 📸"
                        }
                    ],
                    "remaining_retries": 2,
                    "async_step": true
                }
            ],
            "if": null
        }
    ]
}
  1. Replace <flow_name> with the name of your flow.
  2. Replace <color> with a hash followed by a hexadecimal representation of the color. (e.g., #CCCCCC).
  3. Replace <logo_url> with the url of the logo of your company.
  4. Replace <validation_1> and <validation_2> with the names of the validations. (i.e., enter_authorization, email_verification, phone_verification, document_verification, document_verification_with_face_recognition, and document_verification_with_liveness). Keep in mind that, if you are to define steps within your identity_verifications, any redirect_url added must be secure, meaning it must begin with https.
  5. Add as more validations as you need in the identity verifications parameter according to the json syntax previously defined.Keep in mind that you can have up to six validations and the order they are entered matches the order they will be shown to the final user
  6. Send the request. Copy the flow_id from the response, you will need it later to search or edit your flow.