User management
Step-by-Step Workflow: Sign-up
To create a user using the Shield API, the first step is to use the endpoint for sending an OTP to the email/phone. It is mandatory to include the query parameter with the email value to recognize that the user is registering for the first time.
Important! Due to limitations of the WhatsApp API, if you want to use this OTP, you must keep in mind that the user must have previously spoken to the InsureHero number in order to receive the message.
Create OPT
POST
https://app.insurehero.io/api/shield/v1/users/:userId/otp
Headers
Authorization*
string
Bearer access token
Query Parameters
searchBy*
email or phone*
Field use to create a temp register of the user
Path Parameters
userId
*
string
Email or phone
Example Response
Check OTP
Once the OTP is received, you must verify it to create a pre-registered user (this is not enough to create a claim).
POST
https://app.insurehero.io/api/shield/v1/users/:userId/verify-otp
Headers
Authorization*
string
Bearer access token
Query Parameters
searchBy*
email or phone*
Field use to create a temp register of the user
Path Parameters
userId
*
string
Email or phone
Request Body
otp
*
string
The OPT generated for the user
Example Response
Register a user
Once the user is pre-registered with the previous steps, you can register them. This endpoint enables the creation of a user within the channel. These users are then designated as authorized claimants in the risk item, and the relationship is established based on email. If the user doesn't exist at the time of being added as an authorized claimant, there's no issue. Utilizing this endpoint automatically establishes the relationship via email.
PATCH
https://app.insurehero.io/api/shield/v1/users/:userId?searchBy=email
Headers
Authorization*
string
Bearer access token
Query Parameters
searchBy*
email*
Field use to create a temp register of the user
Path Parameters
userId
*
string
Request Body
first_name*
string
User's first name
last_name*
string
User's last name
phone*
string
User's phone number (Must be unique)
gender
string
MALE | FEMALE
dob
string
User's date of birth
address
json
The user's address information
document_type
string
The type of document can be: PASSPORT, RUC, CI and CURP
document_number
string
The user's document number
bank_accounts
BankAccountType[]
User bank accounts
company_name
string
User company name
company_role
string
User company role
company_email
string
User company email
company_identifier
CompanyIdentifierType
User company identifier
company_address
json
The user's company address information
company_bank_accounts
BankAccountType[]
The object fields are the same fields as bank_accounts
uid
string
Additional user's unique identifier in your system. You will be able to use it to search for a user later
group_id
string
The id of the group a user should belong to
metadata
object
Additional data to include in the user record.
Example Response
Step-by-Step Workflow: Sign-in
Create OPT
Once you already have the user registered, you can send the OTP by id, uid, or email of it
POST
https://app.insurehero.io/api/shield/v1/users/:userId/otp
Headers
Authorization*
string
Bearer access token
Query Parameters
searchBy
email | id | uid | phone
Field use to search for a matching user. Default to "id"
Path Parameters
userId
*
string
Either user_id, uid, phone or email
Example Response
Check OTP
Once the OTP is received, it must be validated to verify the ownership of the email. After registration, it can be sent via email, ID, or UID. The response will include a token, which you must use as a header with the key User-Authorization
.
POST
https://app.insurehero.io/api/shield/v1/users/:userId/verify-otp
Headers
Authorization*
string
Bearer access token
Query Parameters
searchBy
email | id | uid | phone
Field use to search for a matching user. Default to "id"
Path Parameters
userId
*
string
Either user_id, uid, phone or email
Request Body
otp
*
string
The OPT generated for the user
Example Response
Users
Get all the users
Get a list of all available users in your channel
GET
https://app.insurehero.io/api/shield/v1/users
Headers
Authorization*
string
Bearer access token
Query Parameters
from*
number
Starting record index
to*
number
Ending record index
Get a specific user
You can get a user using its uid or id.
Headers
Authorization*
string
Bearer access token
Path Parameters
userId*
string
Either user_id or uid
Query Parameters
searchBy
id | uid
Field use to search for a matching user. Default to 'id'
Or using its email.
GET
https://api.insurehero.io/api/shield/v1/users/by-email/:userEmail
Path Parameters
userEmail*
string
The user email
Example Response
Groups
Create new group in a channel
POST
https://app.insurehero.io/api/shield/v1/groups
Headers
Authorization*
string
Bearer access token
Request Body
name*
string
Group name unique
description
string
Group description
bussiness_industry*
string
Bussiness industry
company_name
string
Group company name
company_role
string
Group company role
company_email
string
Group company email
company_identifier
CompanyIdentifierType
Group company identifier
company_address
json
The groups's company address information
company_bank_accounts
BankAccountType[]
The object fields are: account_name, bank_name, account_number, bic_swift, iba, routing_number, country, currency, account_type, bank_address and additional_info. All of type string. All of type string
uid
string
Asssign your unique identifier "yourUID01"
metadata
object
Additional data to include in the group
CompanyIdentifierType
It is an object that has the following values
Type
string
Value
string
BankAccountType
It is an array of objects where each object can have the following values:
account_name
string
bank_name
string
account_number
string
bic_swift
string
iba
string
routing_number
string
country
string
currency
string
account_type
string
bank_address
string
additional_info
string
Get all the groups
Get a list of all available groups in your channel
GET
https://app.insurehero.io/api/shield/v1/groups
Headers
Authorization*
string
Bearer access token
Query Parameters
from*
number
Starting record index
to*
number
Ending record index
Register a user without OTP
To create a user directly, you will need to contact our support team. Once you have requested authorization and it has been granted, you will be provided with the specific instructions to carry out this action.
POST
https://app.insurehero.io/api/shield/v1/users
Headers
Authorization*
string
Bearer access token
Request Body
first_name*
string
User's first name
last_name*
string
User's last name
email*
string
User's email
phone*
string
User's phone number (Must be unique)
gender
string
MALE | FEMALE
dob
string
User's date of birth
address
json
The user's address information
document_type
string
The type of document can be: PASSPORT, RUC, CI and CURP
document_number
string
The user's document number
bank_accounts
BankAccountType[]
User bank accounts
company_name
string
User company name
company_role
string
User company role
company_email
string
User company email
company_identifier
CompanyIdentifierType
User company identifier
company_address
json
The user's company address information
company_bank_accounts
BankAccountType[]
The object fields are the same fields as bank_accounts
uid
string
Additional user's unique identifier in your system. You will be able to use it to search for a user later
group_id
string
The id of the group a user should belong to
metadata
object
Additional data to include in the user record.
Example Response
Last updated