The Ingestion API is used to send new device data to Edge Impulse. It’s available on both HTTP and HTTPS endpoints and requires an API key to authenticate. The API is available at:Documentation Index
Fetch the complete documentation index at: https://docs.edgeimpulse.com/llms.txt
Use this file to discover all available pages before exploring further.
Supported file types
With the Ingestion API, you can upload the following types of files:| Data type | Extension | Acquisition format | Annotation formats |
|---|---|---|---|
| Sensor | .json, .cbor | JSON CBOR | labels, structured labels |
| Sensor | .csv | CSV | labels, structured labels |
| Audio | .wav | - | labels, structured labels |
| Image | .jpg, .png | - | labels, object detection |
| Video* | .mp4, .avi | - | labels |
| Labels | .labels | - | labels, structured labels, object detection |
Endpoints
Files endpoint
There are three endpoints available:POST /api/training/files- for gathering training data.POST /api/testing/files- for gathering testing data. If you have the ‘Live classification’ page open in your browser the file will automatically be classified against the current impulse.POST /api/anomaly/files- for anomaly data from deployed devices.
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.Content-type- format of data used. Can beapplication/cbor,application/json,multipart/form-data.
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.