🟢API for Subjects
This page contains description of subjects management via API.
A SaaS Subject is a unique end-user (person) that uses your application powered by Haut.AI technology, e.g., one of your customers or one of your study participants.
What can you do?
You can find more details on these actions in the Subject section of Swagger.
Clear subject's data (GDPR-related actions)
Create subject
Create a subject connected to your user (e.g. the user user1
connects to your app, you create a subject with the name user1
, so you can easily find all the images of this user), uniqueness of the subject is not required, but it's recommended to use unique subjects' names to identify users and their images along with results later easily.
Every subject has an internal id ID in SaaS (it looks like this 2fea742a-62ec-4a81-9729-9e0283f9c40c
), it's a good practice to have a mapping of our IDs to users within your app or platform.
Create a new subject
Serializer to get dataset id from urls.
subject birth date
subject biological sex id
subject meta data
POST /api/v1/companies/{company_id}/datasets/{dataset_id}/subjects/ HTTP/1.1
Host: saas.haut.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 67
{
"name": "text",
"birth_date": null,
"biological_sex": null,
"meta": null
}
{
"name": "text",
"birth_date": null,
"biological_sex": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"tech_name": "text"
},
"meta": null,
"id": "123e4567-e89b-12d3-a456-426614174000",
"author_id": null,
"creation_time": "2025-10-08T20:00:33.223Z",
"company": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text"
},
"dataset": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text"
},
"promote_image_id": null
}
Update subject
Update subject
PATCH /api/v1/companies/{company_id}/datasets/{dataset_id}/subjects/{subject_id}/ HTTP/1.1
Host: saas.haut.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 67
{
"name": "text",
"birth_date": null,
"biological_sex": null,
"meta": null
}
{
"name": "text",
"birth_date": null,
"biological_sex": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"tech_name": "text"
},
"meta": null,
"id": "123e4567-e89b-12d3-a456-426614174000",
"author_id": null,
"creation_time": "2025-10-08T20:00:33.223Z",
"company": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text"
},
"dataset": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text"
},
"promote_image_id": null
}
List subjects in dataset
List subjects
A search term.
A page number within the paginated result set.
Number of results to return per page.
GET /api/v1/companies/{company_id}/datasets/{dataset_id}/subjects/ HTTP/1.1
Host: saas.haut.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"count": 123,
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2",
"results": [
{
"name": "text",
"birth_date": null,
"biological_sex": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"tech_name": "text"
},
"meta": null,
"id": "123e4567-e89b-12d3-a456-426614174000",
"author_id": null,
"creation_time": "2025-10-08T20:00:33.223Z",
"company": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text"
},
"dataset": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text"
},
"promote_image_id": null
}
]
}
Delete subject
If you delete a subject, you won't be able to upload images to it anymore. You must recreate subject to do it. Otherwise you would get an API error.
Delete a subject
Delete subject
No response body
No content
DELETE /api/v1/companies/{company_id}/datasets/{dataset_id}/subjects/{subject_id}/ HTTP/1.1
Host: saas.haut.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No response body
No content
Delete multiple subjects
Delete multiple subjects in one request
DELETE /api/v1/companies/{company_id}/datasets/{dataset_id}/subjects/delete/?subjects_ids=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Host: saas.haut.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"deleted": [
"123e4567-e89b-12d3-a456-426614174000"
]
}
Clear subject's data (GDPR-related actions)
Delete photos from storage
There are 2 types of objects in SaaS platform: Image file in Storage and Image record in Database.
Image file is the original image, uploaded by client - you - to SaaS platform.
Image record is a record in database, that contains links to:
Image file in storage
Associated objects like Metrics and Masks results and Aux Images
When you trigger "Delete photos from storage" action via API, SaaS deletes immediately Image files from Storage. But this action does not delete Image record, so all associated objects like Metrics and Masks results for this image and Aux Images for this image will NOT be deleted.
Clear images from storage for subject. This action will not delete images from database
DELETE /api/v1/companies/{company_id}/datasets/{dataset_id}/subjects/{subject_id}/storage/ HTTP/1.1
Host: saas.haut.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"status": "text"
}
Clear subject metadata
Clear fields: meta , biological sex, birthdate, phenotype and metrics and submetrics for subject
Clear fields: meta , biological_sex, birthdate, phenotype and metrics and submetrics for subject
DELETE /api/v1/companies/{company_id}/datasets/{dataset_id}/subjects/{subject_id}/metadata/ HTTP/1.1
Host: saas.haut.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"status": "text"
}
Last updated
Was this helpful?