Confident Cannabis API - Client Endpoints

Read-only endpoints for testing clients to view their associated labs, orders, samples, and test results.

OpenAPI Specification

confident-cannabis-client-openapi.json Raw ↑
{
  "openapi": "3.1.0",
  "info": {
    "title": "Clients",
    "version": "0.16.0",
    "description": "API endpoints for clients to view their orders, samples, and associated labs. All endpoints are read-only (GET) and accessible only with client API credentials.",
    "contact": {
      "name": "Confident Cannabis API Support",
      "url": "https://www.confidentcannabis.com"
    }
  },
  "servers": [
    {
      "url": "https://api.confidentcannabis.com",
      "description": "Production server"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "description": "Client organization information",
      "name": "Client Info"
    },
    {
      "description": "Reference data for sample metadata",
      "name": "Reference Data"
    },
    {
      "description": "View associated labs",
      "name": "Labs"
    },
    {
      "description": "View orders and order details",
      "name": "Orders"
    },
    {
      "description": "View samples and test results",
      "name": "Samples"
    }
  ],
  "paths": {
    "/v0/clients/client": {
      "get": {
        "summary": "Get current client information",
        "description": "Returns information about the authenticated client organization.",
        "operationId": "getClient",
        "tags": [
          "Client Info"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with client details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "client"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "client": {
                      "type": "object",
                      "description": "Detailed information about a client organization",
                      "required": [
                        "id",
                        "name",
                        "training",
                        "last_modified"
                      ],
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Unique client ID",
                          "example": 123
                        },
                        "name": {
                          "type": "string",
                          "description": "Organization name",
                          "example": "Green Valley Dispensary"
                        },
                        "email": {
                          "type": "string",
                          "format": "email",
                          "description": "Organization email",
                          "example": "contact@greenvalley.com"
                        },
                        "phone": {
                          "type": "string",
                          "description": "Organization phone number",
                          "example": "(555) 123-4567"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "description": "Organization website",
                          "example": "https://greenvalley.com"
                        },
                        "training": {
                          "type": "boolean",
                          "description": "Whether this is a training/demo client",
                          "example": false
                        },
                        "last_modified": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Last modification timestamp",
                          "example": "2025-01-15T10:30:00Z"
                        },
                        "primary_address": {
                          "type": "object",
                          "description": "Physical address",
                          "properties": {
                            "street": {
                              "type": "string",
                              "example": "123 Main St"
                            },
                            "city": {
                              "type": "string",
                              "example": "Denver"
                            },
                            "state": {
                              "type": "string",
                              "example": "CO"
                            },
                            "zip": {
                              "type": "string",
                              "example": "80202"
                            },
                            "country": {
                              "type": "string",
                              "example": "USA"
                            }
                          }
                        },
                        "licenses": {
                          "type": "array",
                          "description": "Business licenses",
                          "items": {
                            "type": "object",
                            "description": "Business license information",
                            "properties": {
                              "license_number": {
                                "type": "string",
                                "example": "MED-12345"
                              },
                              "license_type": {
                                "type": "string",
                                "example": "Medical Marijuana Dispensary"
                              },
                              "state": {
                                "type": "string",
                                "example": "CO"
                              },
                              "expiration_date": {
                                "type": "string",
                                "format": "date",
                                "example": "2026-12-31"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Successful client response",
                    "value": {
                      "success": true,
                      "client": {
                        "id": 123,
                        "name": "Green Valley Dispensary",
                        "email": "contact@greenvalley.com",
                        "phone": "(555) 123-4567",
                        "url": "https://greenvalley.com",
                        "training": false,
                        "last_modified": "2025-01-15T10:30:00Z",
                        "primary_address": {
                          "street": "123 Main St",
                          "city": "Denver",
                          "state": "CO",
                          "zip": "80202",
                          "country": "USA"
                        },
                        "licenses": [
                          {
                            "license_number": "MED-12345",
                            "license_type": "Medical Marijuana Dispensary",
                            "state": "CO",
                            "expiration_date": "2026-12-31"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response",
                  "required": [
                    "success",
                    "error_code",
                    "error_message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error_code": {
                      "type": "string",
                      "example": "missing_api_key"
                    },
                    "error_message": {
                      "type": "string",
                      "example": "Missing API key header"
                    },
                    "error_details": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response",
                  "required": [
                    "success",
                    "error_code",
                    "error_message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error_code": {
                      "type": "string",
                      "example": "permission_denied"
                    },
                    "error_message": {
                      "type": "string",
                      "example": "Access denied"
                    },
                    "error_details": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v0/clients/samplecategories": {
      "get": {
        "summary": "Get all sample categories",
        "description": "Returns a list of all sample categories (hidden from public documentation).",
        "operationId": "getClientSampleCategories",
        "tags": [
          "Reference Data"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with list of sample categories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "sample_categories"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "sample_categories": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response",
                  "required": [
                    "success",
                    "error_code",
                    "error_message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error_code": {
                      "type": "string",
                      "example": "missing_api_key"
                    },
                    "error_message": {
                      "type": "string",
                      "example": "Missing API key header"
                    },
                    "error_details": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response",
                  "required": [
                    "success",
                    "error_code",
                    "error_message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error_code": {
                      "type": "string",
                      "example": "permission_denied"
                    },
                    "error_message": {
                      "type": "string",
                      "example": "Access denied"
                    },
                    "error_details": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v0/clients/sampleclassifications": {
      "get": {
        "summary": "Get all sample classifications",
        "description": "Returns a list of all sample classifications (hidden from public documentation).",
        "operationId": "getClientSampleClassifications",
        "tags": [
          "Reference Data"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with list of sample classifications",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "sample_classifications"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "sample_classifications": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response",
                  "required": [
                    "success",
                    "error_code",
                    "error_message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error_code": {
                      "type": "string",
                      "example": "missing_api_key"
                    },
                    "error_message": {
                      "type": "string",
                      "example": "Missing API key header"
                    },
                    "error_details": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response",
                  "required": [
                    "success",
                    "error_code",
                    "error_message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error_code": {
                      "type": "string",
                      "example": "permission_denied"
                    },
                    "error_message": {
                      "type": "string",
                      "example": "Access denied"
                    },
                    "error_details": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v0/clients/sampleproductionmethods": {
      "get": {
        "summary": "Get all sample production methods",
        "description": "Returns a list of all sample production methods (hidden from public documentation).",
        "operationId": "getClientSampleProductionMethods",
        "tags": [
          "Reference Data"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with list of production methods",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "sample_production_methods"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "sample_production_methods": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response",
                  "required": [
                    "success",
                    "error_code",
                    "error_message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error_code": {
                      "type": "string",
                      "example": "missing_api_key"
                    },
                    "error_message": {
                      "type": "string",
                      "example": "Missing API key header"
                    },
                    "error_details": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response",
                  "required": [
                    "success",
                    "error_code",
                    "error_message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error_code": {
                      "type": "string",
                      "example": "permission_denied"
                    },
                    "error_message": {
                      "type": "string",
                      "example": "Access denied"
                    },
                    "error_details": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v0/clients/sampletypes": {
      "get": {
        "summary": "Get all sample types",
        "description": "Returns a list of all sample types (hidden from public documentation).",
        "operationId": "getClientSampleTypes",
        "tags": [
          "Reference Data"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with list of sample types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "sample_types"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "sample_types": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response",
                  "required": [
                    "success",
                    "error_code",
                    "error_message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error_code": {
                      "type": "string",
                      "example": "missing_api_key"
                    },
                    "error_message": {
                      "type": "string",
                      "example": "Missing API key header"
                    },
                    "error_details": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response",
                  "required": [
                    "success",
                    "error_code",
                    "error_message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error_code": {
                      "type": "string",
                      "example": "permission_denied"
                    },
                    "error_message": {
                      "type": "string",
                      "example": "Access denied"
                    },
                    "error_details": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v0/clients/lab/{lab_id}": {
      "get": {
        "summary": "Get lab details",
        "description": "Returns detailed information about a specific lab.",
        "operationId": "getLabDetails",
        "tags": [
          "Labs"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "lab_id",
            "in": "path",
            "description": "The ID of the lab",
            "required": true,
            "schema": {
              "type": "integer",
              "example": 456
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with lab details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "lab"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "lab": {
                      "type": "object",
                      "description": "Detailed information about a lab",
                      "required": [
                        "id",
                        "name",
                        "state",
                        "city"
                      ],
                      "properties": {
                        "id": {
                          "type": "integer",
                          "example": 456
                        },
                        "name": {
                          "type": "string",
                          "example": "Rocky Mountain Testing Lab"
                        },
                        "email": {
                          "type": "string",
                          "format": "email",
                          "example": "info@rmtlab.com"
                        },
                        "phone": {
                          "type": "string",
                          "example": "(555) 987-6543"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "example": "https://rmtlab.com"
                        },
                        "state": {
                          "type": "string",
                          "example": "CO"
                        },
                        "city": {
                          "type": "string",
                          "example": "Denver"
                        },
                        "primary_address": {
                          "type": "object",
                          "description": "Physical address",
                          "properties": {
                            "street": {
                              "type": "string",
                              "example": "123 Main St"
                            },
                            "city": {
                              "type": "string",
                              "example": "Denver"
                            },
                            "state": {
                              "type": "string",
                              "example": "CO"
                            },
                            "zip": {
                              "type": "string",
                              "example": "80202"
                            },
                            "country": {
                              "type": "string",
                              "example": "USA"
                            }
                          }
                        },
                        "last_modified": {
                          "type": "string",
                          "format": "date-time",
                          "example": "2025-01-10T08:00:00Z"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response",
                  "required": [
                    "success",
                    "error_code",
                    "error_message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error_code": {
                      "type": "string",
                      "example": "missing_api_key"
                    },
                    "error_message": {
                      "type": "string",
                      "example": "Missing API key header"
                    },
                    "error_details": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response",
                  "required": [
                    "success",
                    "error_code",
                    "error_message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error_code": {
                      "type": "string",
                      "example": "permission_denied"
                    },
                    "error_message": {
                      "type": "string",
                      "example": "Access denied"
                    },
                    "error_details": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response",
                  "required": [
                    "success",
                    "error_code",
                    "error_message"
                  ],
                  "properties": {
                    "su

# --- truncated at 32 KB (81 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/confident-cannabis/refs/heads/main/openapi/confident-cannabis-client-openapi.json