Upload a sample CoA

POST /v0/labs/sample/{sample_id}/coa

Attach a certificate of analysis to the sample and make it the sample's current CoA. Each upload increments the CoA version, so reposting replaces the CoA rather than adding a second one.

Allowed extensions are pdf, and a CoA can only be added while the order is in progress (status_id 3) - otherwise the endpoint returns the invalid_order_status error.

Send the file as a file field in a standard multipart/form-data request, and leave file fields out of signature generation.

Path parameters

sample_id string required

Body parameters (multipart/form-data)

coa file required

The CoA PDF to attach.

Try it

Log in to send test requests to this endpoint straight from the docs.

Responses

200 Success

No fields beyond the success envelope.

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.

How to sign requests
# X-ConfidentLims-Signature: see the Request Signing guide - https://api.confidentcannabis.com/v0/docs/request-signing.md
curl -X POST 'https://api.confidentcannabis.com/v0/labs/sample/{sample_id}/coa' \
  -H 'X-ConfidentLims-APIKey: YOUR_API_KEY' \
  -H 'X-ConfidentLims-Timestamp: UNIX_TIMESTAMP' \
  -H 'X-ConfidentLims-Signature: REQUEST_SIGNATURE' \
  -F 'coa=@/path/to/file'
Response · 200
{
  "success": true
}