User management
Endpoints
POST
POST
PATCH
POST
GET
GET
POST
GET
POST
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
Attributes
data
object
Object containing the response details.
message
string
Confirmation message indicating that the OTP has been sent successfully to the user's email.
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
Additional attributes
data
object
Main container that holds all user information.
id
uuid
Unique identifier of the user.
channel_id
string
Identifier of the channel.
account_name
string
Name of the bank account holder.
bank_name
string
Name of the bank.
account_number
string
Bank account number.
bic_swift
string
SWIFT or BIC code of the bank.
iban
string
IBAN (International Bank Account Number).
routing_number
string
Routing number for the bank.
country
string
Country where the bank account is held.
currency
string
Currency type for the bank account.
account_type
string
Type of bank account.
bank_address
string
Address of the bank branch.
additional_info
string
Any additional information regarding the bank account.
type
string
Type of company identifier.
value
string
The actual identifier value.
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
Attributes
data
object
Object containing the response details.
message
string
Confirmation message indicating the OTP was successfully sent to the user’s email.
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
Attributes
data
object
Object containing the validation result.
message
string
A token returned after successful OTP validation. This token must be used in the request header as User-Authorization.
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
Attributes
data
object
Main container that holds all user information.
id
uuid
Unique identifier of the user.
channel_id
uuid
Identifier of the channel.
string
Email of user.
first_name
string
User's first name.
last_name
string
User's last name.
phone
string
User's phone number (Must be unique).
uid
string
Additional user's unique identifier in your system.
gender
string
MALE | FEMALE.
dob
string
User's date of birth.
address
string
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
string
User bank accounts.
company_name
string
User company name.
company_role
string
User company role.
company_email
string
User company email.
company_identifier
string
User company identifier.
company_address
string
The user's company address information.
company_bank_accounts
string
The object fields are the same fields as bank_accounts.
group_id
uuid
The id of the group;
metada
object
Additional data to include in the user record.
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
Attributes
data
object
Main container that holds all user information.
id
uuid
Unique identifier of the user.
channel_id
string
Identifier of the channel.
account_name
string
Name of the bank account holder.
bank_name
string
Name of the bank.
account_number
string
Bank account number.
bic_swift
string
SWIFT or BIC code of the bank.
iban
string
IBAN (International Bank Account Number).
routing_number
string
Routing number for the bank.
country
string
Country where the bank account is held.
currency
string
Currency type for the bank account.
account_type
string
Type of bank account.
bank_address
string
Address of the bank branch.
additional_info
string
Any additional information regarding the bank account.
type
string
Type of company identifier.
value
string
The actual identifier value.
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
Attributes
data
string
Main container that holds all group information.
id
uuid
Unique identifier for the group.
name
string
Name of the group.
description
string
Description of the group.
bussiness_industry
string
Industry to which the group belongs.
company_name
string
Name of the company associated with the group.
company_role
string
Role of the company.
company_email
string
Contact email of the company.
company_identifier
string
Unique identifier for the company.
company_address
string
Address of the company.
company_bank_accounts
number
Bank account number associated with the company.
uid
string
Unique identifier for the group within the system.
metadata
object
Additional metadata related to the group.
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
Attributes
data
object
Main container that holds all user information.
id
uuid
Unique identifier of the user.
channel_id
string
Identifier of the channel.
account_name
string
Name of the bank account holder.
bank_name
string
Name of the bank.
account_number
string
Bank account number.
bic_swift
string
SWIFT or BIC code of the bank.
iban
string
IBAN (International Bank Account Number).
routing_number
string
Routing number for the bank.
country
string
Country where the bank account is held.
currency
string
Currency type for the bank account.
account_type
string
Type of bank account.
bank_address
string
Address of the bank branch.
additional_info
string
Any additional information regarding the bank account.
type
string
Type of company identifier.
value
string
The actual identifier value.
Last updated