Integrate coanalysis into your cannabis compliance workflow with our powerful REST API.
All API requests require authentication using API keys. Generate your API key in the dashboard settings.
Authorization: Bearer YOUR_API_KEYAll API endpoints are relative to the base URL:
https://api.coanalysis.io/v1Retrieve a list of all certificates for your account.
GET /certificates| Parameter | Type | Description |
|---|---|---|
| limit | integer | Number of results to return (default: 50, max: 100) |
| offset | integer | Number of results to skip (default: 0) |
| status | string | Filter by status: active, expired, pending |
{
"data": [
{
"id": "cert_123",
"name": "Blue Dream COA - Batch #BD2024001",
"product_id": "prod-001",
"lab_name": "Pacific Lab Services",
"test_date": "2024-01-15",
"expiry_date": "2025-01-15",
"status": "active",
"file_url": "https://files.coanalysis.io/cert_123.pdf",
"created_at": "2024-01-16T10:30:00Z"
}
],
"pagination": {
"total": 25,
"limit": 50,
"offset": 0
}
}Upload a new Certificate of Analysis.
POST /certificates| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Certificate name |
| product_id | string | Yes | Associated product ID |
| lab_name | string | Yes | Testing laboratory name |
| file | file | Yes | PDF file (max 10MB) |
Retrieve your product catalog with linked certificates.
GET /products{
"data": [
{
"id": "prod-001",
"name": "Blue Dream",
"sku": "BD-001",
"category": "flower",
"status": "active",
"shopify_id": "shopify-123",
"certificates": [
{
"id": "cert_123",
"name": "Blue Dream COA - Batch #BD2024001",
"status": "active",
"expiry_date": "2025-01-15"
}
],
"created_at": "2024-01-10T08:00:00Z"
}
]
}Generate embeddable widget code for a product.
POST /widgets/generate{
"product_id": "prod-001",
"style": "minimal", // or "detailed"
"show_expiry": true,
"theme": "light" // or "dark"
}{
"widget_id": "widget_abc123",
"embed_code": "<iframe src='https://widgets.coanalysis.io/widget_abc123' width='300' height='200'></iframe>",
"preview_url": "https://widgets.coanalysis.io/preview/widget_abc123"
}| Code | Status | Description |
|---|---|---|
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Insufficient permissions |
| 404 | Not Found | Resource not found |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error occurred |
Rate limit headers are included in all responses: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
Token balance is returned in API responses: X-Token-Balance, X-Token-Used
Our developer support team is here to help you integrate with the coanalysis API.