Configure Your App Backend and SaaS for Integration
This page describes the necessary steps needed to start building a custom app, powered by Haut.AI
Important to Know Before You Start
Haut.AI supports multiple options to build a custom app, allowing for both web and native (mobile) apps and a very wide range of use cases due to the flexible usage of APIs. However, several limitations must be accounted for from the very beginning.
Building any custom application with Haut.AI requires your app always to have a working backend because all described API methods are "backend-to-backend" only.
There are no options to build custom apps with Haut.AI services by interacting without the backend. If you do not have/do not plan to have the backend in your app, we highly recommend you consider trying our Skin Consultant App feature.
Haut.AI continuously follows the industry's best practices to ensure optimal performance and security while supporting backward compatibility. Because of that, all Haut.AI API methods (described in this guide, described in SaaS API Overview or listed in other parts of Haut.AI documentation) can be changed (improved, added, or even deprecated) in the future.
We advise you to stay subscribed to our updates emails about new releases to ensure that you are aware of new best practices, new features, and incoming deprecations.
Login to SaaS
To interact with any API method, you’ll first need to log in using your account credentials.
Check the Login API reference for details about the relevant API methods.
Provide your email and password to authenticate.
The response will contain the
access_token
andcompany_id
.
What do these objects mean?
Access Token (
access_token
) is a short-lived token that you’ll need to include in the headers for all subsequent requests.This token is temporary, usually expiring after a short period (e.g., one hour). Once it expires, you’ll need to log in again to get a new one.
The token should be included in the authorization header for any future requests.
This token is not recommended for using API. Instead, follow the next step #create-long-living-private-token
Company ID (
company_id
) is a unique identifier for your company, which may be required in certain API requests. Thecompany_id
is tied to your account.
Critical Information
Treat both the access_token
and company_id
as sensitive information. Store them securely at your backend and avoid exposing them.
Create Long-Living Private Token for SaaS API
After the successful API for Login, you can now authenticate and proceed with using the API. If your access_token
expired earlier, repeat the login action.
The next step is to create a long-living token (it's called a Private Token). This token is meant for backend server use, allowing you to make API requests without constantly re-authenticating.
Check the Private tokens API reference for details about the relevant API methods.
Provide a short-lived token in the authorization header.
The response will contain the Private Token under the
data
field.
Once the Private Token is created, use it for any subsequent requests to the SaaS API by simply including the Private Token in the Authorization
a header like this:
The token is used in the Bearer
format, so make sure to prefix it with the word "Bearer," followed by a space and then your token.
Critical Information
Even though the Private Token is long-lived, it will eventually expire.
You need to set an expiration time that works best for your use case to prevent expiration at unexpected moments. See how to do it here
Haut.AI highly recommends always choosing the shortest expiration time you can safely work with and rotating your Private Tokens regularly to minimize risk.
Regularly rotate your Private Tokens to reduce the risk of unauthorized access. See how to do it here
Create Dataset in SaaS
After the successful creation of API for Private Tokens, you can now authenticate for a long time and proceed with using the API. If your Private Token expired earlier, repeat creation of Private Token.
The next step is to create a Dataset. Datasets are spaces where you can store and manage your end-user data, such as images and metrics.
Check the Datasets feature description for details about datasets.
Check the Datasets API Reference for details about the relevant API methods.
The
name
of the dataset is the only required field when creating a new Dataset.You’ll also notice that your
company_id
is used as part of the URL path for the Dataset creation.As soon as a new Dataset is created, you can retrieve a Dataset
id
.
Critical information
1 custom application is always recommended to be equal to 1 dataset.
Datasets are designed to store data from a specific activation/market/study (depending on your use case). Please make sure to create a new Dataset only when a new activation/market/study starts.
To make it easier to navigate and create Datasets, avoid creating new Datasets for each new image or subject.
See #configure-webhooks to understand why creating multiple datasets for one custom application breaks the logic for real-time data transfer.
Attach Algorithms Application to Dataset in SaaS
After the successful creation of API for Datasets, you can now attach Algorithms Application(s) to your Dataset. Algorithms are an AI core functionality of Haut.AI products. Algorithms enable AI image analysis.
Check the Algorithms feature description for details about Algorithms.
Check the Algorithms Applications API Reference for details about the relevant methods.
Use the Algorithm Application
tech_name
in URL pathUse the Dataset
id
to which you would like to attach the selected Algorithm Application.
FAQ about Algorithms application
Can I detach an Algorithm Application from the Dataset?
Unfortunately, no. Algorithm Applications can not be detached manually. If you need it, please contact our support team.
How many Algorithm Applications can I attach to the Dataset?
You can attach all available Algorithm Applications to any Dataset.
Please keep in mind that each Algorithm Application will process every uploaded image to the dataset, adding to the number of API calls used for this. Thus number of API calls will be subtracted from your Subscription Plan quota.
Which Algorithm Applications can I attach?
Some Algorithm Applications depend on the results of other Algorithm Applications, so you should always attach them together (check this section in the API overview for more information).
Configure Webhooks for Dataset in SaaS
After the successful attachment of API for Algorithm Applications to Dataset, we recommend configuring a Webhook to streamline the process of receiving results from each skin analysis.
Webhooks offer a convenient, real-time push model for receiving analysis results instantly. This reduces the need for polling and saves resources for both your server and the API.
Check the Feature description for more details.
Check the Webhooks API Overview for details about the relevant methods.
FAQ about webhooks
Please be informed that Webhooks can be configured only at the Dataset level, meaning each dataset can have its own webhook setup.
Currently, each Dataset supports only one Webhook destination. This means that results from the Dataset can be consumed by just one system.
If you need to send data in real-time to multiple systems, we highly encourage you to consider using specialized automation services such as Zapier. See our guide for integrating SaaS with Klaviyo CRM via Zapier.
Next Steps
Follow our next guide Integrate Haut.AI Image Analysis with Your Appto find out how to:
Upload photos: Send the photos you want to analyze to the dataset using the appropriate API calls.
Receive results: via Webhooks or via API methods.
Last updated