Edit a sample
Update one or more fields on a sample. Only the fields you send are changed.
Samples can only be edited while their order is in the 'placed' or 'in progress' status; editing a sample on an order in any other status returns the invalid_order_status error. A sample belonging to another lab returns 404 rather than 403.
The IDs for type_id, production_method_id and classification_id are the same ones used when creating a sample, and are listed at GET /sampletypes, GET /sampleproductionmethods and GET /sampleclassifications. The new sample type must belong to the same industry as the sample and its order.
The regulator sample ID cannot be edited through this API, because regulator requirements for changing it differ from state to state.
Path parameters
Body parameters (application/x-www-form-urlencoded)
Display name for the sample.
Strain the sample came from.
Sample type ID, from GET /sampletypes.
Production method ID, from GET /sampleproductionmethods.
Classification ID, from GET /sampleclassifications.
Date the sample was harvested or produced.
Manifest ID in the state's seed-to-sale system.
Batch ID from the client's inventory system.
Size of the batch the sample came from.
Unit for batch_size: units, lb or g.
Lot ID from the client's inventory system.
Size of the lot the sample came from.
Unit for lot_size: units, lb or g.
Production run ID from the client's system.
Size of the production run.
Unit for production_run_size: units, lb or g.
Serving size, in units.
Number of servings in one container.
What one unit means for this sample.
What one container means for this sample.
Batch ID in the state's seed-to-sale tracking system.
(for Leaf) Pre-transfer batch ID.
(for Leaf) Pre-transfer inventory or lot ID.
Lot ID in the state's seed-to-sale tracking system.
Harvest lot ID in the state's seed-to-sale tracking system.
Free-text notes about the sample.
Sample ID in the lab's own LIMS.
Date the sample was collected.
Lab-defined custom field.
Arbitrary JSON stored alongside the sample.
Date the results are due back to the client.
Try it
Log in to send test requests to this endpoint straight from the docs.
Responses
200 Success
Show 90 child attributes Hide 90 child attributes
Sample ID
Orders ID
Client ID
Lab
Show 2 child attributes Hide 2 child attributes
Lab ID
Lab Name
Order Status ID
Order Status Name
Name of Sample
Name of Sample Strain
Sample Industry ID
Sample Industry Name
Sample Category ID
Sample Category Name
Sample Type ID
Sample Type Name
Sample Classification ID
Sample Classification Name
Production Method name
Production Method ID
Unique ID from the state's seed-to-sale tracking system of the sample tested by the lab
Unique ID from the state's seed-to-sale tracking system of the client's batch from which the sample tested by the lab came
Unique ID from the client's inventory management system of the client's batch from which the sample tested by the lab came
Unique ID from the state's seed-to-sale tracking system of the client's harvest lot from which the sample tested by the lab came
Show 4 child attributes Hide 4 child attributes
Unique ID for Test Package
Test Package Name
Package Price - if 0, call for price
Minimum sample quantity required for testing
Time this sample was last modified
Published Date [when sample was published]
Sample weight at order verification
Unit type for Initial Weight
Show 3 child attributes Hide 3 child attributes
Unique ID for Test Type
Test Type Name
Test Type Abbreviation
Show 3 child attributes Hide 3 child attributes
Unique public key for file
Public URL to access file
Will also contain cover image
Show 3 child attributes Hide 3 child attributes
Unique public key for file
Public URL to access file
Notes about the sample
Size of the client's batch from which the sample tested by the lab came
Unit type for batch size (units, lb, or g)
Unique ID from the client's inventory management system of the client's lot from which the sample tested by the lab came
Size of the client's lot from which the sample tested by the lab came
Unit type for lot size (units, lb, or g)
Unique ID from the client's inventory management system of the client's production run from which the sample tested by the lab came
Size of the client's production run from which the sample tested by the lab came
Unit type for production run size (units, lb, or g)
Unique ID from the state's seed-to-sale tracking system of the sample manifest from which the sample tested by the lab came
Unique ID from the state's seed-to-sale tracking system of the client's lot from which the sample tested by the lab came
(for Leaf) Pre-Transfer Batch ID
(for Leaf) Pre-Transfer Inventory/Lot ID
Harvest/Production Date [when sample was produced]
Collection Date [when sample was collected]
Unique URL for viewing this sample or CoA without requiring a login. Should be added to CoAs and used for QR codes or other barcode images so end consumers can verify the integrity of the data
Serving Size
Number of Servings in one Container
Information describing what a "unit" means for this sample (i.e 1 Bottle)
Information describing what a "unit" means for this sample (i.e 1 Gummy)
Unique ID for sample's regulatory category
Information about the solvents used in testing
True if sample has a Certificate of Analysis
URL expires after one hour
Show 3 child attributes Hide 3 child attributes
Unique public key for file
Public URL to access file
URLs expire after one hour
Show 3 child attributes Hide 3 child attributes
Unique public key for file
Public URL to access file
Orders lims ID
Sample lims ID
Current weight on hand
Unit type for weight measurements (units, g, or ml)
True if sample has test results
True if sample has draft test results
True if sample has a draft Certificate of Analysis
URL expires after one hour
Show 3 child attributes Hide 3 child attributes
Unique public key for file
Public URL to access file
Show 4 child attributes Hide 4 child attributes
Name of user who added log
Unique ID for user who added log
Timestamp of log creation time
Log Content
Custom Field
Custom External Json Data
Custom data field
Custom data field
Custom data field
Custom data field
Custom data field
Custom data field
Custom data field
Custom data field
Custom data field
Custom data field
Custom data field for dates
Custom data field for dates
Custom data field for dates
Custom data field for dates
Custom data field for dates
Custom data field for yes/no fields
Custom data field for yes/no fields
Custom data field for yes/no fields
Custom data field for yes/no fields
Custom data field for yes/no fields
Total price of test packages with custom client pricing and discounts included
Due date
True if sample has rushed test types
List of rushed test type abbreviations
400 Bad request
The request was malformed or failed validation. Validation failures include per-field messages in error_details.
Possible error_code values: invalid_request, request_too_old.
401 Unauthorized
Authentication failed.
Possible error_code values: missing_api_key, invalid_api_key, invalid_credentials_type, api_access_restricted, api_access_denied, missing_signature, missing_timestamp, invalid_timestamp, invalid_signature.
403 Permission denied
The API key is valid but does not have permission for this endpoint (for example, a client key calling a labs endpoint).
Possible error_code values: permission_denied.
404 Not found
The requested record does not exist or is not visible to this organization.
Possible error_code values: not_found.
# X-ConfidentLims-Signature: see the Request Signing guide - https://api.confidentcannabis.com/v0/docs/request-signing.md
curl -X PATCH 'https://api.confidentcannabis.com/v0/labs/sample/{sample_id}' \
-H 'X-ConfidentLims-APIKey: YOUR_API_KEY' \
-H 'X-ConfidentLims-Timestamp: UNIX_TIMESTAMP' \
-H 'X-ConfidentLims-Signature: REQUEST_SIGNATURE'
import time import requests # sign_request() is defined in the Request Signing guide: # https://api.confidentcannabis.com/v0/docs/request-signing.md from sign_request import sign_request API_KEY = 'YOUR_API_KEY' API_SECRET = 'YOUR_API_SECRET' path = '/v0/labs/sample/{sample_id}' data = { # optional form fields go here - they are signed too } headers = {'X-ConfidentLims-Timestamp': str(int(time.time()))} headers['X-ConfidentLims-Signature'] = sign_request( 'PATCH', path, headers, data, API_KEY, API_SECRET) headers['X-ConfidentLims-APIKey'] = API_KEY response = requests.patch( 'https://api.confidentcannabis.com' + path, headers=headers, data=data, ) print(response.json())
// signRequest() is defined in the Request Signing guide: // https://api.confidentcannabis.com/v0/docs/request-signing.md import { signRequest } from './sign_request.js'; const API_KEY = 'YOUR_API_KEY'; const API_SECRET = 'YOUR_API_SECRET'; const path = "/v0/labs/sample/{sample_id}"; const data = { // optional form fields go here - they are signed too }; const headers = { 'X-ConfidentLims-Timestamp': String(Math.floor(Date.now() / 1000)) }; headers['X-ConfidentLims-Signature'] = signRequest( "PATCH", path, headers, data, API_KEY, API_SECRET); headers['X-ConfidentLims-APIKey'] = API_KEY; const response = await fetch("https://api.confidentcannabis.com" + path, { method: "PATCH", headers, body: new URLSearchParams(data), }); console.log(await response.json());
{
"success": true,
"sample": {
"id": "2601-0143-1",
"order_id": "2601-0143",
"client_id": 812,
"lab": {
"id": 44,
"name": "Cascade Analytics"
},
"order_status_id": 3,
"order_status_name": "In Progress",
"sample_name": "Blue Dream Flower",
"strain_name": "Blue Dream",
"sample_industry_id": 1,
"sample_industry_name": "Cannabis & Hemp",
"sample_category_id": 1,
"sample_category_name": "Plant",
"sample_type_id": 1,
"sample_type_name": "Flower - Cured",
"sample_classification_id": 9,
"sample_classification_name": "Sativa Dominant",
"production_method_id": 3,
"production_method_name": "Greenhouse",
"regulator_sample_id": "1A4060300003B71000001234",
"regulator_batch_id": "1A4060300003B71000001180",
"batch_id": "BD-2026-08-A",
"harvest_id": "HARVEST-2026-07-BD",
"test_packages": [
{
"id": 12,
"name": "Compliance Panel",
"price": 275.0,
"minimum_quantity": 1
}
],
"last_modified": "2026-08-14T18:03:12",
"date_published": null,
"order_lims_id": "ORD-2026-0143",
"lims_id": "S-2026-0143-1",
"initial_weight": 12.0,
"initial_weight_unit": "g",
"test_types": [
{
"id": 1,
"name": "Cannabinoids",
"abbreviation": "CAN"
}
],
"cover_image": null,
"images": [],
"notes": "Received in a sealed mylar bag.",
"batch_size": 4500.0,
"batch_size_unit": "g",
"lot_id": "LOT-BD-118",
"lot_size": 4500.0,
"lot_size_unit": "g",
"production_run_id": null,
"production_run_size": null,
"production_run_size_unit": null,
"manifest_id": "0000012345",
"regulator_lot_id": null,
"regulator_sample_id2": null,
"regulator_batch_id2": null,
"production_date": "2026-07-28",
"date_samples_collected": "2026-08-12",
"public_url": "https://orders.confidentcannabis.com/verify/2fd1c0a9",
"units_per_serving": null,
"servings_per_container": null,
"unit_description": null,
"container_description": null,
"regulatory_category_id": 7,
"solvents_used": null,
"has_coa": false,
"coa": null,
"coa_additions": [],
"weight_on_hand": 9.5,
"weight_on_hand_unit": "g",
"has_lab_data": false,
"has_lab_data_draft": false,
"has_coa_draft": false,
"logs": [
{
"user_name": "API",
"user_id": null,
"log_time": "2026-08-14T18:03:12",
"message": "Sample edited via API"
}
],
"custom_field": null,
"external_data": null,
"test_package_total_price": 275.0,
"due_date": "2026-08-19",
"has_rushed_test_types": false,
"rushed_test_types": []
}
}