post
https://{targetURL}/api/v1/samples
Creates a single sample of the chosen sample type, optionally with meta-field values and an initial quantity. Use this for one-off creates from your client; for bulk imports prefer POST /samples/bulk.
Behaviour to know about:
- By default the call does not create any meta fields, even when the sample type marks them required. Set
autoCreateMetaDefaults=true(query parameter) to populate meta fields whose sample-type definition has a default value or auto-numbering — fields without either are still skipped. quantitySettingsis optional. Leave it out for samples whose type doesn't track quantity. If the sample type hasquantityRequiredset, omittingquantitySettingsis rejected with 400.sampleMetasmay be omitted (treated as empty). To bind a value to a field defined on the sample type, set itssampleTypeMetaID(resolve these viaGET /sampleTypes/{sampleTypeID}/meta) and match the field'ssampleDataType. A meta supplied without asampleTypeMetaIDis still accepted, but is stored as a free, unconnected meta: its value is still matched by general full-text search, but it cannot be used as a structured per-field search filter.
Returns the new sampleID.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…