🟢API for Datasets

This page contains description of datasets management via API.

Datasets are spaces where you can store and manage your end-user data, such as images and metrics.

What is dataset?

What can you do

You can find more details on these actions in the Dataset section of Swagger.

Create dataset

Please do not create a dataset for each analysis. Create a dataset for your app, your study, or something big.

Create dataset

post

Create a new dataset

Authorizations
Path parameters
company_idstring · uuidRequired
Body

Serializer to get company id from urls with author.

namestring · min: 1 · max: 512Required
image_type_idinteger | nullOptional

dataset image type id, you can find all available image types in /dicts/image_types/ API method

expire_images_after_daysinteger | null · max: 365Optional
expire_metadata_after_daysinteger | null · max: 365Optional
clean_images_as_soon_as_readybooleanOptional
custom_brandinginteger | nullOptional
Responses
201Success
application/json
post
POST /api/v1/companies/{company_id}/datasets/ HTTP/1.1
Host: saas.haut.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 162

{
  "name": "text",
  "image_type_id": null,
  "expire_images_after_days": null,
  "expire_metadata_after_days": null,
  "clean_images_as_soon_as_ready": true,
  "custom_branding": null
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "company_id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "image_type": {
    "id": 1,
    "name": "text",
    "tech_name": "text",
    "sides": [
      {
        "id": 1,
        "name": "text",
        "tech_name": "text"
      }
    ],
    "lights": [
      {
        "id": 1,
        "name": "text",
        "tech_name": "text"
      }
    ]
  },
  "image_type_name": "text",
  "image_type_tech_name": "text",
  "connected_applications": [
    {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "expire_images_after_days": null,
  "expire_metadata_after_days": null,
  "clean_images_as_soon_as_ready": true,
  "algorithms_bucketing": [
    {
      "data": null
    }
  ],
  "custom_branding": {
    "id": 1,
    "name": "text",
    "json_content": null
  }
}

Optional Features for Dataset Creation

When creating a dataset, you can customize its behavior using several optional fields. These options give you control over how long images and their metadata are stored, as well as when to clean up images after processing.

Optional Fields:

  1. expire_images_after_days:

    • Set this to any positive integer (including 0) to automatically delete uploaded images after the specified number of days.

    • Default value: images are not deleted at all.

    • Example: If set to 7, images will be deleted 7 days after they are uploaded.

    • Note: if you visited UI and opened an image, it is cached in the browser for 24 hours, so you will still see it in UI even after auto-deletion.

  2. expire_metadata_after_days:

    • This works similarly to expire_images_after_days, but applies to the subject metadata (birth_date, phenotype, biological_sex, meta fields) and metrics and submetrics stored in the dataset.

    • Default value: metadata is not deleted at all.

    • If set to any positive integer (including 0), the metadata and results will be cleared from the database after the specified number of days.

  3. clean_images_as_soon_as_ready:

    • If set to true, uploaded images will be scheduled for deletion 60 minutes after the algorithms finish processing. This helps to reduce storage usage by cleaning up images that are no longer needed immediately after processing.

    • Default value: images are not deleted at all.

    • Note: if you visited UI and opened an image, it is cached in the browser for 24 hours, so you will still see it in UI even after auto-deletion.

Use Cases:

  • Short-term storage: If you're working with sensitive data or want to minimize storage costs, use expire_images_after_days and clean_images_as_soon_as_ready to ensure images are cleaned up quickly. Critical to notice: if you need any help with understanding why image is processed "like that", with these settings our Support team can not help, as images are already deleted.

  • Long-term metadata retention: You can still retain algorithm results and metadata for a longer period using expire_metadata_after_days, even after the images are deleted


List datasets

Retrieve a list of all datasets associated with your company. This is useful for managing multiple datasets, keeping track of usage, and reviewing the status of stored data.

Get datasets list

get
Authorizations
Path parameters
company_idstring · uuidRequired
Query parameters
qstringOptional

A search term.

pageintegerOptional

A page number within the paginated result set.

page_sizeintegerOptional

Number of results to return per page.

Responses
200Success
application/json
get
GET /api/v1/companies/{company_id}/datasets/ HTTP/1.1
Host: saas.haut.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success
{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "company_id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "image_type": {
        "id": 1,
        "name": "text",
        "tech_name": "text",
        "sides": [
          {
            "id": 1,
            "name": "text",
            "tech_name": "text"
          }
        ],
        "lights": [
          {
            "id": 1,
            "name": "text",
            "tech_name": "text"
          }
        ]
      },
      "image_type_name": "text",
      "image_type_tech_name": "text",
      "connected_applications": [
        {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        }
      ],
      "author": {
        "id": 1,
        "email": "[email protected]",
        "username": "[email protected]"
      },
      "creation_time": "2025-10-08T19:21:15.651Z"
    }
  ]
}


Delete dataset

You can delete a dataset when it’s no longer needed. Deleting a dataset will remove all images, metadata, and metrics and submetrics stored within it.

Delete dataset

delete
Authorizations
Path parameters
company_idstring · uuidRequired
dataset_idstring · uuidRequired
Responses
200Success
application/json
delete
DELETE /api/v1/companies/{company_id}/datasets/{dataset_id}/ HTTP/1.1
Host: saas.haut.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "deleted": "123e4567-e89b-12d3-a456-426614174000"
}

Update dataset

Certain fields in a dataset can be modified after creation. This allows you to update key attributes like the dataset's name or adjust optional features such as expiration settings (expire_images_after_days, expire_metadata_after_days, etc.).

Update dataset

patch
Authorizations
Path parameters
company_idstring · uuidRequired
dataset_idstring · uuidRequired
Body
namestring · min: 1 · max: 512Optional
custom_brandinginteger | nullOptional
expire_images_after_daysinteger | null · max: 2147483647Optional
expire_metadata_after_daysinteger | null · max: 2147483647Optional
clean_images_as_soon_as_readybooleanOptional
Responses
200Success
application/json
patch
PATCH /api/v1/companies/{company_id}/datasets/{dataset_id}/ HTTP/1.1
Host: saas.haut.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 141

{
  "name": "text",
  "custom_branding": null,
  "expire_images_after_days": null,
  "expire_metadata_after_days": null,
  "clean_images_as_soon_as_ready": true
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "company_id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "image_type": {
    "id": 1,
    "name": "text",
    "tech_name": "text",
    "sides": [
      {
        "id": 1,
        "name": "text",
        "tech_name": "text"
      }
    ],
    "lights": [
      {
        "id": 1,
        "name": "text",
        "tech_name": "text"
      }
    ]
  },
  "image_type_name": "text",
  "image_type_tech_name": "text",
  "connected_applications": [
    {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "expire_images_after_days": null,
  "expire_metadata_after_days": null,
  "clean_images_as_soon_as_ready": true,
  "algorithms_bucketing": [
    {
      "data": null
    }
  ],
  "custom_branding": {
    "id": 1,
    "name": "text",
    "json_content": null
  }
}

Last updated

Was this helpful?