Supported file types
With the Ingestion API, you can upload the following types of files:
*Video files can be split into individual frames after uploading to Studio.
Endpoints
Files endpoint
These are the endpoints available for the Ingestion API:POST /api/training/files- for adding data samples to the training setPOST /api/validation/files- for adding data samples to the validation setPOST /api/testing/files- for adding data samples to the test setPOST /api/post-processing/files- for adding data samples to the post-processing setPOST /api/split/files- for adding samples automatically split across the training, validation, and test sets
- The maximum number of files you can upload in a single request is 1000
- The maximum size of a single file is 100 MB
- The validation endpoint is only available if the explicit validation set advanced setting is enabled in your project
- The split endpoint splits the files into training, validation, and test sets based on the split percentages defined in your project
- If you have the ‘Live classification’ page open in your browser while uploading to the testing endpoint, the file will automatically be classified against the current impulse.
api/training/files endpoint is the following:
Data endpoint (legacy)
Because thefiles endpoints expect Content-Type to be multipart/form-data, there are also available legacy endpoints that require simpler requests:
POST /api/training/dataPOST /api/testing/dataPOST /api/anomaly/data
api/training/data endpoint is the following:
Header Parameters
x-api-key- API Key (required).x-label- Label (optional). If this header is not provided a label is automatically inferred from the filename through the following regex:^[a-zA-Z0-9\s-_]+- For example: idle.01 will yield the label idle. If you don’t want to assign the label nor derive it from the file name, provide anx-no-labelheader with the value1.x-disallow-duplicates- When set, the server checks the hash of the message against your current dataset (optional). We’d recommend setting this header but haven’t enabled it by default for backward compatibility.x-add-date-id: 1 - to add a date ID to the filename. For example: if you upload with filename test.wav the file name will be test - set this option and we’ll add a unique ID to the end (this is what we use on the daemon to create unique names).x-metadata- JSON-encoded string of key/value pairs to attach as metadata to the uploaded sample(s) (optional). For example:{"site":"Paris","source":"field-trial-2"}. Metadata can be used to control train/validation splits, drive data pipeline synchronisation, and slice model performance by attribute.x-bounding-boxes- JSON-encoded array of bounding boxes to attach to the uploaded image(s) (optional, object detection projects only). See Bounding boxes below.Content-type- format of data used. Can beapplication/cbor,application/json, ormultipart/form-data.
Bounding boxes
For object detection projects you can label images at upload time by passing anx-bounding-boxes header. The value is a JSON-encoded array of objects, each requiring all five of the following properties:
Coordinates are absolute pixel values relative to the top-left corner of the image, not normalized 0..1 values.
For example, to send two boxes:
The header applies to every file in the requestWhen you upload multiple files in a single
multipart/form-data request, the same x-bounding-boxes value is applied to all of them. To label each file individually, either send one request per image, or include a bounding_boxes.labels file in the request, which takes precedence over the header on a per-file basis.Validation errors
If the header cannot be parsed, or a box is missing a required property, the affected file is rejected and not stored. Note that thefiles endpoints still return HTTP 200 in this case. The per-file outcome is reported in the response body, so you must inspect files[].success rather than relying on the status code alone:
x-bounding-boxes is not valid json, x-bounding-boxes is not a valid array, and x-bounding-boxes <property> is required for each of label, x, y, width and height. A property is also reported as missing when it has the wrong type. For example, a string "120" instead of the number 120.
Responses
All responses are sent with content typetext/plain. The following response codes may be returned:
200- Stored the file, file name is in the body.400- Invalid message, e.g. fields are missing, or are invalid. See body for more information.401- Missingx-api-keyheader, or invalid API key.421- Missing header, see body for more information.500- Internal server error, see body for more information.