Confident Cannabis API - Common Reference Data
Shared reference-data endpoints (compounds, test types, sample types, categories, classifications, production methods, order statuses).
Shared reference-data endpoints (compounds, test types, sample types, categories, classifications, production methods, order statuses).
{
"openapi": "3.1.0",
"info": {
"title": "Common",
"version": "0.16.0",
"description": "Reference data endpoints for compounds, test types, and sample metadata. These endpoints are accessible to both labs and clients and provide standardized data for use throughout the API.",
"contact": {
"name": "Confident Cannabis API Support",
"url": "https://www.confidentcannabis.com"
}
},
"servers": [
{
"url": "https://api.confidentcannabis.com",
"description": "Production server"
}
],
"security": [
{
"ApiKeyAuth": []
}
],
"tags": [
{
"description": "Endpoints for retrieving reference data used throughout the API",
"name": "Reference Data"
}
],
"paths": {
"/v0/compounds": {
"get": {
"summary": "Get all compounds",
"description": "Returns a list of all compounds and compound synonyms in Confident Cannabis. This includes alternate spellings and synonyms. All compounds listed can be used in test results submission using the `name` parameter. Response is cached for 30 minutes.",
"operationId": "getCompounds",
"tags": [
"Reference Data"
],
"security": [
{
"ApiKeyAuth": []
}
],
"responses": {
"200": {
"description": "Successful response with list of compounds",
"headers": {
"Cache-Control": {
"description": "Cache duration",
"schema": {
"type": "string",
"example": "max-age=1800"
}
}
},
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Response containing list of compounds",
"required": [
"success",
"compounds"
],
"properties": {
"success": {
"type": "boolean",
"description": "Whether the request was successful",
"example": true
},
"compounds": {
"type": "array",
"description": "Array of compounds and compound synonyms",
"items": {
"type": "object",
"description": "A compound or compound synonym that can be used in test results",
"required": [
"category",
"name",
"display_name",
"is_synonym",
"synonym_for_compound_name"
],
"properties": {
"category": {
"type": "string",
"description": "Test category under which this compound is normally tested",
"example": "Cannabinoids"
},
"name": {
"type": "string",
"description": "Unique name used to identify the compound. Use this value when submitting test results.",
"example": "thc"
},
"display_name": {
"type": "string",
"description": "Human-readable display name for the compound",
"example": "THC"
},
"is_synonym": {
"type": "boolean",
"description": "True if this is a synonym for another compound, false if it is a primary compound",
"example": false
},
"synonym_for_compound_name": {
"type": "string",
"description": "If is_synonym is true, this contains the name of the primary compound. Empty string otherwise.",
"example": ""
}
}
}
}
}
},
"examples": {
"success": {
"summary": "Successful compounds response",
"value": {
"success": true,
"compounds": [
{
"category": "Cannabinoids",
"name": "thc",
"display_name": "THC",
"is_synonym": false,
"synonym_for_compound_name": ""
},
{
"category": "Cannabinoids",
"name": "cbd",
"display_name": "CBD",
"is_synonym": false,
"synonym_for_compound_name": ""
},
{
"category": "Cannabinoids",
"name": "thca",
"display_name": "THCa",
"is_synonym": false,
"synonym_for_compound_name": ""
},
{
"category": "Terpenes",
"name": "limonene",
"display_name": "Limonene",
"is_synonym": false,
"synonym_for_compound_name": ""
},
{
"category": "Terpenes",
"name": "d-limonene",
"display_name": "d-Limonene",
"is_synonym": true,
"synonym_for_compound_name": "limonene"
}
]
}
}
}
}
}
},
"401": {
"description": "Authentication failed - missing or invalid API key, signature, or timestamp",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Error response returned when a request fails",
"required": [
"success",
"error_code",
"error_message"
],
"properties": {
"success": {
"type": "boolean",
"description": "Always false for error responses",
"example": false
},
"error_code": {
"type": "string",
"description": "Machine-readable error code",
"enum": [
"missing_api_key",
"invalid_api_key",
"missing_signature",
"invalid_signature",
"missing_timestamp",
"request_too_old",
"api_access_denied",
"api_access_restricted",
"permission_denied",
"invalid_request",
"not_found"
],
"example": "missing_api_key"
},
"error_message": {
"type": "string",
"description": "Human-readable error message",
"example": "Missing API key header"
},
"error_details": {
"type": "object",
"description": "Additional error details (e.g., validation errors)",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"examples": {
"missing_api_key": {
"summary": "Missing API key",
"value": {
"success": false,
"error_code": "missing_api_key",
"error_message": "Missing API key header"
}
},
"invalid_api_key": {
"summary": "Invalid API key",
"value": {
"success": false,
"error_code": "invalid_api_key",
"error_message": "Invalid API key"
}
},
"invalid_signature": {
"summary": "Invalid signature",
"value": {
"success": false,
"error_code": "invalid_signature",
"error_message": "Signature verification failed"
}
}
}
}
}
},
"403": {
"description": "Access denied - insufficient permissions",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Error response returned when a request fails",
"required": [
"success",
"error_code",
"error_message"
],
"properties": {
"success": {
"type": "boolean",
"description": "Always false for error responses",
"example": false
},
"error_code": {
"type": "string",
"description": "Machine-readable error code",
"enum": [
"missing_api_key",
"invalid_api_key",
"missing_signature",
"invalid_signature",
"missing_timestamp",
"request_too_old",
"api_access_denied",
"api_access_restricted",
"permission_denied",
"invalid_request",
"not_found"
],
"example": "permission_denied"
},
"error_message": {
"type": "string",
"description": "Human-readable error message",
"example": "You do not have permission to access this resource"
},
"error_details": {
"type": "object",
"description": "Additional error details (e.g., validation errors)",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"examples": {
"permission_denied": {
"summary": "Permission denied",
"value": {
"success": false,
"error_code": "permission_denied",
"error_message": "You do not have permission to access this resource"
}
}
}
}
}
}
}
}
},
"/v0/orderstatuses": {
"get": {
"summary": "Get all order statuses",
"description": "Returns a list of all possible order statuses and their IDs.",
"operationId": "getOrderStatuses",
"tags": [
"Reference Data"
],
"security": [
{
"ApiKeyAuth": []
}
],
"responses": {
"200": {
"description": "Successful response with list of order statuses",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Response containing list of order statuses",
"required": [
"success",
"order_statuses"
],
"properties": {
"success": {
"type": "boolean",
"description": "Whether the request was successful",
"example": true
},
"order_statuses": {
"type": "array",
"description": "Array of order statuses",
"items": {
"type": "object",
"description": "A possible status for an order",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer",
"description": "Unique ID for the order status",
"example": 1
},
"name": {
"type": "string",
"description": "Name of the order status",
"example": "Placed"
},
"description": {
"type": "string",
"description": "Description of what this status means",
"example": "Order has been placed but not yet verified"
}
}
}
}
}
},
"examples": {
"success": {
"summary": "Successful order statuses response",
"value": {
"success": true,
"order_statuses": [
{
"id": 1,
"name": "Placed",
"description": "Order has been placed but not yet verified"
},
{
"id": 3,
"name": "In Progress",
"description": "Order is currently being processed"
},
{
"id": 4,
"name": "Completed",
"description": "Order has been completed"
},
{
"id": 5,
"name": "Canceled",
"description": "Order has been canceled"
}
]
}
}
}
}
}
},
"401": {
"description": "Authentication failed - missing or invalid API key, signature, or timestamp",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Error response returned when a request fails",
"required": [
"success",
"error_code",
"error_message"
],
"properties": {
"success": {
"type": "boolean",
"description": "Always false for error responses",
"example": false
},
"error_code": {
"type": "string",
"description": "Machine-readable error code",
"enum": [
"missing_api_key",
"invalid_api_key",
"missing_signature",
"invalid_signature",
"missing_timestamp",
"request_too_old",
"api_access_denied",
"api_access_restricted",
"permission_denied",
"invalid_request",
"not_found"
],
"example": "missing_api_key"
},
"error_message": {
"type": "string",
"description": "Human-readable error message",
"example": "Missing API key header"
},
"error_details": {
"type": "object",
"description": "Additional error details (e.g., validation errors)",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"examples": {
"missing_api_key": {
"summary": "Missing API key",
"value": {
"success": false,
"error_code": "missing_api_key",
"error_message": "Missing API key header"
}
},
"invalid_api_key": {
"summary": "Invalid API key",
"value": {
"success": false,
"error_code": "invalid_api_key",
"error_message": "Invalid API key"
}
},
"invalid_signature": {
"summary": "Invalid signature",
"value": {
"success": false,
"error_code": "invalid_signature",
"error_message": "Signature verification failed"
}
}
}
}
}
},
"403": {
"description": "Access denied - insufficient permissions",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Error response returned when a request fails",
"required": [
"success",
"error_code",
"error_message"
],
"properties": {
"success": {
"type": "boolean",
"description": "Always false for error responses",
"example": false
},
"error_code": {
"type": "string",
"description": "Machine-readable error code",
"enum": [
"missing_api_key",
"invalid_api_key",
"missing_signature",
"invalid_signature",
"missing_timestamp",
"request_too_old",
"api_access_denied",
"api_access_restricted",
"permission_denied",
"invalid_request",
"not_found"
],
"example": "permission_denied"
},
"error_message": {
"type": "string",
"description": "Human-readable error message",
"example": "You do not have permission to access this resource"
},
"error_details": {
"type": "object",
"description": "Additional error details (e.g., validation errors)",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"examples": {
"permission_denied": {
"summary": "Permission denied",
"value": {
"success": false,
"error_code": "permission_denied",
"error_message": "You do not have permission to access this resource"
}
}
}
}
}
}
}
}
},
"/v0/samplecategories": {
"get": {
"summary": "Get all sample categories",
"description": "Returns a list of all sample categories.",
"operationId": "getSampleCategories",
"tags": [
"Reference Data"
],
"security": [
{
"ApiKeyAuth": []
}
],
"responses": {
"200": {
"description": "Successful response with list of sample categories",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Response containing list of sample categories",
"required": [
"success",
"sample_categories"
],
"properties": {
"success": {
"type": "boolean",
"description": "Whether the request was successful",
"example": true
},
"sample_categories": {
"type": "array",
"description": "Array of sample categories",
"items": {
"type": "object",
"description": "A category for grouping sample types",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer",
"description": "Unique ID for the sample category",
"example": 1
},
"name": {
"type": "string",
"description": "Name of the sample category",
"example": "Cannabis Product"
}
}
}
}
}
},
"examples": {
"success": {
"summary": "Successful sample categories response",
"value": {
"success": true,
"sample_categories": [
{
"id": 1,
"name": "Cannabis Product"
},
{
"id": 2,
"name": "Infused Product"
},
{
"id": 3,
"name": "Plant Material"
}
]
}
}
}
}
}
},
"401": {
"description": "Authentication failed - missing or invalid API key, signature, or timestamp",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Error response returned when a request fails",
"required": [
"success",
"error_code",
"error_message"
],
"properties": {
"success": {
"type": "boolean",
"description": "Always false for error responses",
"example": false
},
"error_code": {
"type": "string",
"description": "Machine-readable error code",
"enum": [
"missing_api_key",
"invalid_api_key",
"missing_signature",
"invalid_signature",
"missing_timestamp",
"request_too_old",
"api_access_denied",
"api_access_restricted",
"permission_denied",
"invalid_request",
"not_found"
],
"example": "missing_api_key"
},
"error_message": {
"type": "string",
"description": "Human-readable error message",
"example": "Missing API key header"
},
"error_details": {
"type": "object",
"description": "Additional error details (e.g., validation errors)",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"examples": {
"missing_api_key": {
"summary": "Missing API key",
"value": {
"success": false,
"error_code": "missing_api_key",
"error_message": "Missing API key header"
}
},
"invalid_api_key": {
"summary": "Invalid API key",
"value": {
"success": false,
"error_code": "invalid_api_key",
"error_message": "Invalid API key"
}
},
"invalid_signature": {
"summary": "Invalid signature",
"value": {
"success": false,
"error_code": "invalid_signature",
"error_message": "Signature verification failed"
}
}
}
}
}
},
"403": {
"description": "Access denied - insufficient permissions",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Error response returned when a request fails",
"required": [
"success",
"error_code",
"error_message"
],
"properties": {
"success": {
"type": "boolean",
"description": "Always false for error responses",
"example": false
},
"error_code": {
"type": "string",
"description": "Machine-readable error code",
"enum": [
"missing_api_key",
"invalid_api_key",
"missing_signature",
"invalid_signature",
"missing_timestamp",
"request_too_old",
"api_access_denied",
"api_access_restricted",
"permission_denied",
"invalid_request",
"not_found"
],
"example": "permission_denied"
},
"error_message": {
"type": "string",
"description": "Human-readable error message",
"example": "You do not have permission to access this resource"
},
"error_details": {
"type": "object",
"description": "Additional error details (e.g., validation errors)",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"examples": {
"permission_denied": {
"summary": "Permission denied",
"value": {
"success": false,
"error_code": "permission_denied",
"error_message": "You do not have permission to access this resource"
}
}
}
}
}
}
}
}
},
"/v0/sampleclassifications": {
"get": {
"summary": "Get all sample classifications",
"description": "Returns a list of all sample classifications (Indica, Sativa, Hybrid, etc.).",
"operationId": "getSampleClassifications",
"tags": [
"Reference Data"
],
"security": [
{
"ApiKeyAuth": []
}
],
"responses": {
"200": {
"description": "Successful response with list of sample classifications",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Response containing list of sample classifications",
"required": [
"success",
"sample_classifications"
],
"properties": {
"success": {
"type": "boolean",
"description": "Whether the request was successful",
"example": true
},
"sample_classifications": {
"type": "array",
"description": "Array of sample classifications",
"items": {
"type": "object",
"description": "A classification for cannabis samples (strain type)",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer",
"description": "Unique ID for the classification",
"example": 1
},
"name": {
"type": "string",
"description": "Name of the classification",
"example": "Indica"
}
}
}
}
}
},
"examples": {
"success": {
"summary": "Successful sample classifications response",
"value": {
"success": true,
"sample_classifications": [
# --- truncated at 32 KB (66 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/confident-cannabis/refs/heads/main/openapi/confident-cannabis-common-openapi.json