API Reference
The Coggno API is organized around REST. It has predictable, resource-oriented URLs, accepts URL-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. This document covers v2 - the v1 API remains available but is no longer extended, so new integrations should use v2.
Endpoints
All API requests are made over HTTPS against the following base URLs.
| Environment | Base URL |
|---|---|
| Production | https://api.coggno.com/v2 |
| Sandbox | https://sandbox-app.coggno.com/api/v2 |
Authentication
The Coggno API uses API keys to authenticate requests. View and manage your keys on the Settings → API Keys page in your account.
Authenticate by sending the key as the HTTP Basic Auth username, with no password. With curl, pass it as -u API_KEY: (note the trailing colon).
All requests must be made over HTTPS. Calls made over plain HTTP, or without authentication, fail with 401 Unauthorized.
curl https://api.coggno.com/v2/companies -u API_KEY:
Connected accounts
An API key issued to a parent account can act on behalf of any connected LMS (child) account by sending the Coggno-LMS header with the child company’s id.
Without the header, requests are scoped to the parent account. With it, the parent’s own groups, users, documents, and licenses are hidden - only the targeted child’s resources are visible.
curl https://api.coggno.com/v2/groups \ -H "Coggno-LMS: comp_42" \ -u API_KEY:
Dates and times
Timestamps (fields such as created_at) are ISO 8601 in UTC, e.g. 2026-04-30T12:00:00Z.
Dates (fields such as issue_date and expires_at on a certificate) are calendar dates in YYYY-MM-DD form, with no time or time zone.
Neither depends on the account or API key settings.
Errors
Coggno uses conventional HTTP status codes to indicate the outcome of a request. Codes in the 2xx range mean success, 4xx means a client error you can fix (missing parameter, invalid id, expired key), and 5xx means a problem on Coggno’s side.
Error response format
Every error response carries the same JSON shape. The message is human-readable and intended for your logs.
{
"error": {
"message": "User is not found"
}
}
Status codes
| Status | Name | When you’ll see it |
|---|---|---|
| 200 | OK | Request succeeded. |
| 201 | Created | Resource was created. |
| 400 | Bad Request | A parameter was malformed (e.g. an unknown value passed to expand). |
| 401 | Unauthorized | API key missing, invalid, disabled, or expired - or the Coggno-LMS header points at an unreachable account. |
| 403 | Forbidden | The authenticated key does not have permission to act on the target resource. |
| 404 | Not Found | The requested resource does not exist or is not visible to this key. |
| 409 | Conflict | The request conflicts with the current state (e.g. adding a user would exceed the license limit, or deleting a locked group). |
| 422 | Unprocessable Entity | Validation failed - missing or invalid fields, duplicate user, license cannot be launched, etc. |
| 429 | Too Many Requests | Slow down. Retry with exponential backoff. |
| 500 | Server Error | Something went wrong on Coggno’s side. |
Expand related objects
Many endpoints return related resources as bare ids - for example, a license response carries "document": "doc_17". To have the API inline the full related resource instead of the id, pass the expand query parameter.
Using expand
expand accepts either a single key (?expand=document) or multiple keys passed as a repeated array parameter (?expand[]=user&expand[]=document). The allowed keys are user, document, category, sub_category, modules, module_licenses, and licenses.
Passing an unknown key returns 400 Bad Request.
GET /users/user_1/licenses
{
"object": "list",
"data": [
{
"id": "lic_1_17",
"object": "license",
"document": "doc_17",
"amount": 1,
"used": 0,
"score": 0,
"passed": false,
"start_date": null,
"complete_date": null,
"created_at": "2026-04-30T12:00:00Z"
}
]
}
GET /users/user_1/licenses?expand[]=module_licenses&expand[]=document
{
"object": "list",
"data": [
{
"id": "lic_23_77",
"object": "license",
"course_license": true,
"document": {
"id": "doc_77",
"object": "document",
"title": "Workplace Safety Course",
"type": "Course",
"created_at": "2026-04-30T12:00:00Z"
},
"amount": 1,
"used": 1,
"views": 3,
"total_time": 5400,
"score": 88,
"passed": true,
"start_date": "2026-04-15T09:00:00Z",
"complete_date": "2026-04-16T11:42:11Z",
"enrollment_date": "2026-04-14T00:00:00Z",
"created_at": "2026-04-14T17:05:22Z",
"module_licenses": [
{
"id": "lic_23_100",
"object": "license",
"course_license": false,
"document": "doc_100",
"amount": 1,
"used": 1,
"views": 2,
"total_time": 240,
"score": 92,
"passed": true,
"start_date": "2026-04-15T09:00:00Z",
"complete_date": "2026-04-15T10:00:00Z",
"enrollment_date": "2026-04-14T00:00:00Z",
"created_at": "2026-04-14T17:05:22Z"
},
{
"id": "lic_23_101",
"object": "license",
"course_license": false,
"document": "doc_101",
"amount": 1,
"used": 1,
"views": 1,
"total_time": 300,
"score": 84,
"passed": true,
"start_date": "2026-04-16T10:00:00Z",
"complete_date": "2026-04-16T11:42:11Z",
"enrollment_date": "2026-04-14T00:00:00Z",
"created_at": "2026-04-14T17:05:22Z"
}
]
}
]
}
Allowed expand keys per endpoint
| Parameter | Available on | Inlines |
|---|---|---|
| user | GET /companies GET /documents/:id/licenses | The owner / license holder. |
| document | GET /licenses/owned GET /users/:id/licenses GET /groups/:id/licenses/:document_id GET /documents/:id/licenses | The document object. |
| category | GET /documents/:id GET /marketplace/courses/:id GET /marketplace/sub_categories/:id | The category of the document, course or sub-category. |
| sub_category | GET /documents/:id GET /marketplace/courses/:id | The document’s or course’s sub-category. |
| sub_categories | GET /marketplace/categories/:id | The category’s sub-categories shown in the marketplace. |
| modules | GET /documents/:id | The modules (child documents) of a course. |
| module_licenses | GET /documents/:id/licenses GET /users/:id/licenses | The child licenses of a course license. |
| licenses | GET /groups/:id/licenses/:document_id | The group users’ licenses for the document. |
Companies
A company represents a single LMS account. A company owns groups, users, documents, and licenses. Every company created through the API is a connected account of the caller.
List connected companies
/companies
Returns the caller’s own company plus every directly connected child company.
Expandable parameters: user
curl https://api.coggno.com/v2/companies -u API_KEY:
{
"object": "list",
"data": [
{
"id": "comp_1",
"object": "company",
"name": "Acme Training",
"user": "user_1",
"created_at": "2026-04-30T12:00:00Z"
},
{
"id": "comp_42",
"object": "company",
"name": "Northwind LLC",
"user": "user_88",
"created_at": "2026-04-30T12:00:00Z"
}
]
}
Create a connected company
/companies
Provisions a new LMS as a child of the calling account.
Parameters 6
name
first_name
last_name
email
username
password
curl https://api.coggno.com/v2/companies -u API_KEY: \ -d name="Northwind LLC" \ -d first_name=Jane \ -d last_name=Doe \ -d [email protected] \ -d username=jane.doe
{
"id": "comp_42",
"object": "company",
"name": "Northwind LLC",
"user": "user_88",
"created_at": "2026-04-30T12:00:00Z"
}
Groups
Groups partition users inside an LMS. Use groups to model departments, cohorts, or anything you assign training to in bulk.
List groups
/groups
curl https://api.coggno.com/v2/groups -u API_KEY:
{
"object": "list",
"data": [
{
"id": "group_1",
"object": "group",
"name": "Sales",
"description": "Sales department",
"created_at": "2026-04-30T12:00:00Z"
}
]
}
Create a group
/groups
Parameters 2
name
description
curl https://api.coggno.com/v2/groups -u API_KEY: \ -d name=Sales \ -d description="Sales department"
{
"id": "group_1",
"object": "group",
"name": "Sales",
"description": "Sales department",
"created_at": "2026-04-30T12:00:00Z"
}
Retrieve a group
/groups/:id
curl https://api.coggno.com/v2/groups/group_1 -u API_KEY:
{
"id": "group_1",
"object": "group",
"name": "Sales",
"description": "Sales department",
"created_at": "2026-04-30T12:00:00Z"
}
Update a group
/groups/:id
Parameters 2
name
description
curl -X PATCH https://api.coggno.com/v2/groups/group_1 -u API_KEY: \ -d name=Managers \ -d description="Managers department"
{
"id": "group_1",
"object": "group",
"name": "Managers",
"description": "Managers department",
"created_at": "2026-04-30T12:00:00Z"
}
Delete a group
/groups/:id
Group deletion is gated by a name confirmation: the caller must pass the group’s current name in the confirmation parameter. System-locked groups (e.g. the Administrators group) cannot be deleted and return 409 Conflict.
Parameters 1
confirmation
curl -X DELETE https://api.coggno.com/v2/groups/group_1 -u API_KEY: \ -d confirmation=Sales
{
"id": "group_1",
"object": "group",
"deleted": true
}
Group users
Manage group membership. A user can belong to multiple groups within the same LMS.
List group members
/groups/:group_id/users
curl https://api.coggno.com/v2/groups/group_1/users -u API_KEY:
{
"object": "list",
"data": [
{
"id": "user_1",
"object": "user",
"username": "jdoe",
"first_name": "John",
"last_name": "Doe",
"created_at": "2026-04-30T12:00:00Z"
}
]
}
Add a user to a group
/groups/:group_id/users
The user must already belong to the LMS (or to a connected child LMS). The user_id parameter accepts either a user id (user_123) or a username.
Parameters 2
user_id
send_notification
curl https://api.coggno.com/v2/groups/group_1/users -u API_KEY: \ -d user_id=user_1
{
"id": "user_1",
"object": "user",
"username": "jdoe",
"first_name": "John",
"last_name": "Doe",
"created_at": "2026-04-30T12:00:00Z"
}
Retrieve a group member
/groups/:group_id/users/:user_id
The :user_id segment accepts either a user id or a username, as on every users endpoint.
# These two requests resolve to the same user curl https://api.coggno.com/v2/groups/group_1/users/user_1 -u API_KEY: curl https://api.coggno.com/v2/groups/group_1/users/jdoe -u API_KEY:
{
"id": "user_1",
"object": "user",
"username": "jdoe",
"first_name": "John",
"last_name": "Doe",
"created_at": "2026-04-30T12:00:00Z"
}
Remove a user from a group
/groups/:group_id/users/:user_id
Removes the user from the group. The user remains in the LMS.
curl -X DELETE https://api.coggno.com/v2/groups/group_1/users/user_1 -u API_KEY:
{
"id": "user_1",
"object": "user",
"deleted": true
}
Group licenses
Distribute documents to a group. A distributed document becomes a group license available to current and future members.
Distribute a license to a group
/groups/:group_id/licenses
Distributes a single document to every member of the group and returns the created group license. The seat count is reported as amount, where -1 means unlimited. If your account owns the document it is distributed directly; otherwise your Coggno Prime subscription is used when it covers the document, and a license you hold for it after that. The deadline and renewal also apply to licenses your account already issued to current members for that document.
Parameters 4
document_id
send_notification
due_days
recert_interval
curl https://api.coggno.com/v2/groups/group_1/licenses -u API_KEY: \ -d document_id=doc_17
{
"id": "group_lic_1_17",
"object": "group_license",
"document": "doc_17",
"created_at": "2026-04-30T12:00:00Z",
"amount": -1
}
Retrieve a group license
/groups/:group_id/licenses/:document_id
:document_id is the document id (doc_<n>). Returns the group license for that document in the group.
Expandable parameters: document, licenses
curl https://api.coggno.com/v2/groups/group_1/licenses/doc_17 -u API_KEY:
{
"id": "group_lic_1_17",
"object": "group_license",
"document": "doc_17",
"created_at": "2026-04-30T12:00:00Z",
"amount": -1
}
Reset a group license
/groups/:group_id/licenses/:document_id
Resets the group license for the document: every member’s license for it is reset.
curl -X DELETE https://api.coggno.com/v2/groups/group_1/licenses/doc_17 -u API_KEY:
{
"id": "group_lic_1_17",
"object": "group_license",
"deleted": true
}
Users
Manage the users that belong to an LMS. Every endpoint that takes a user identifier accepts either the prefixed id (user_123) or the user’s username.
Looking up users by username
Wherever the API identifies a user in a path segment, you may substitute the user’s username. This applies to GET /users/:id, DELETE /users/:id, every /groups/:group_id/users/:user_id endpoint, and /users/:user_id/licenses.
# These two requests resolve to the same user curl https://api.coggno.com/v2/users/user_1 -u API_KEY: curl https://api.coggno.com/v2/users/jdoe -u API_KEY:
List users
/users
curl https://api.coggno.com/v2/users -u API_KEY:
{
"object": "list",
"data": [
{
"id": "user_1",
"object": "user",
"username": "jdoe",
"first_name": "John",
"last_name": "Doe",
"created_at": "2026-04-30T12:00:00Z"
}
]
}
Create a user
/users
Creates a new user, adds them to the LMS, and optionally to a group. If the LMS has reached its licensed-user limit, returns 409 Conflict. If the email is already in use, returns 422 Unprocessable Entity.
Parameters 7
first_name
last_name
email
username
password
group_id
send_notification
curl https://api.coggno.com/v2/users -u API_KEY: \ -d first_name=John \ -d last_name=Doe \ -d [email protected] \ -d username=jdoe \ -d group_id=group_1
{
"id": "user_1",
"object": "user",
"username": "jdoe",
"first_name": "John",
"last_name": "Doe",
"created_at": "2026-04-30T12:00:00Z"
}
Retrieve a user
/users/:id
curl https://api.coggno.com/v2/users/user_1 -u API_KEY:
{
"id": "user_1",
"object": "user",
"username": "jdoe",
"first_name": "John",
"last_name": "Doe",
"created_at": "2026-04-30T12:00:00Z"
}
Delete a user
/users/:id
Removes the user from the LMS and from every group. The underlying Coggno login is retained - licenses purchased through other channels remain accessible to the user.
curl -X DELETE https://api.coggno.com/v2/users/jdoe -u API_KEY:
{
"id": "user_1",
"object": "user",
"deleted": true
}
Owned licenses
The licenses your account owns - the seat pools you distribute to users. amount is the number of seats, used is the number given out, including seats assigned to users who have not opened the course yet. A license can be distributed while used is less than amount.
List owned licenses
/licenses/owned
Returns the account’s top-level licenses with their seat counts. Documents created in your account need no license and are listed by GET /documents.
Expandable parameters: document
curl https://api.coggno.com/v2/licenses/owned -u API_KEY:
{
"object": "list",
"data": [
{
"id": "lic_5_42",
"object": "owned_license",
"course_license": false,
"document": "doc_42",
"amount": 50,
"used": 15,
"created_at": "2026-04-30T12:00:00Z"
}
]
}
User licenses
A license attaches a user to a document. The list endpoint returns the user’s top-level licenses; for a license that points at a course (a collection of documents), retrieve it by id to see the individual child licenses.
List a user’s top-level licenses
/users/:user_id/licenses
Expandable parameters: document, module_licenses
curl https://api.coggno.com/v2/users/user_1/licenses -u API_KEY:
{
"object": "list",
"data": [
{
"id": "lic_1_17",
"object": "license",
"course_license": false,
"document": "doc_17",
"amount": 1,
"used": 0,
"views": 0,
"total_time": 0,
"score": 0,
"passed": false,
"start_date": null,
"complete_date": null,
"enrollment_date": "2026-04-30T12:00:00Z",
"created_at": "2026-04-30T12:00:00Z"
}
]
}
Distribute a license
/users/:user_id/licenses
Distributes a single document to the user and returns the created license. If your account owns the document it is distributed directly; otherwise your Coggno Prime subscription is used when it covers the document, and a license you already hold for that document after that. Returns 422 if your Prime plan has no free seat for this user.
Parameters 4
document_id
send_notification
due_days
recert_interval
curl https://api.coggno.com/v2/users/user_1/licenses -u API_KEY: \ -d document_id=doc_17
{
"id": "lic_1_17",
"object": "license",
"course_license": false,
"document": "doc_17",
"amount": 1,
"used": 0,
"views": 0,
"total_time": 0,
"score": 0,
"passed": false,
"start_date": null,
"complete_date": null,
"enrollment_date": "2026-04-30T12:00:00Z",
"created_at": "2026-04-30T12:00:00Z"
}
Retrieve a license
/users/:user_id/licenses/:document_id
The :document_id segment is the document id the license targets.
Expandable parameters: document, module_licenses
curl https://api.coggno.com/v2/users/user_1/licenses/doc_17 -u API_KEY:
{
"id": "lic_1_17",
"object": "license",
"course_license": false,
"document": "doc_17",
"amount": 1,
"used": 0,
"views": 0,
"total_time": 0,
"score": 0,
"passed": false,
"start_date": null,
"complete_date": null,
"enrollment_date": "2026-04-30T12:00:00Z",
"created_at": "2026-04-30T12:00:00Z"
}
Get a launch URL
/users/:user_id/licenses/:document_id/launch_url
Mints a signed, time-limited URL that launches the licensed training in the user’s browser. The url expires 10 minutes after it is issued; embed it directly or redirect the user to it. Course licenses cannot be launched at the course level - launch each module license instead.
Expandable parameters: document
curl https://api.coggno.com/v2/users/user_1/licenses/doc_17/launch_url -u API_KEY:
{
"id": "lic_1_17",
"object": "url",
"url": "https://coggno.com/v2/content/start_token/eyJhbGciOi...",
"expires_at": "2026-05-15T15:00:00Z",
"document": "doc_17"
}
Reset a license
/users/:user_id/licenses/:document_id
Resets the user’s license for the document, identified by its document id. A license the user received through a group cannot be removed here - reset it on the group instead.
curl -X DELETE https://api.coggno.com/v2/users/user_1/licenses/doc_17 -u API_KEY:
{
"id": "lic_1_17",
"object": "license",
"deleted": true
}
User certificates
Certificates the user has been issued in your account. A certificate with downloadable false is still being generated, or its generation failed.
List a user’s certificates
/users/:user_id/certificates
Returns the user’s issued certificates, newest first.
curl https://api.coggno.com/v2/users/user_1/certificates -u API_KEY:
{
"object": "list",
"data": [
{
"id": "course_cert_42",
"object": "certificate",
"type": "course",
"name": "Workplace Safety",
"document": "doc_17",
"downloadable": true,
"issue_date": "2026-04-30",
"expires_at": "2027-04-30",
"created_at": "2026-04-30T12:00:00Z"
}
]
}
Retrieve a certificate
/users/:user_id/certificates/:id
curl https://api.coggno.com/v2/users/user_1/certificates/course_cert_42 -u API_KEY:
{
"id": "course_cert_42",
"object": "certificate",
"type": "course",
"name": "Workplace Safety",
"document": "doc_17",
"downloadable": true,
"issue_date": "2026-04-30",
"expires_at": "2027-04-30",
"created_at": "2026-04-30T12:00:00Z"
}
Download a certificate
/users/:user_id/certificates/:id/download
Returns the PDF certificate file as an attachment, for every certificate type. The response body is the binary file itself, not JSON. Returns 409 while the certificate is still being generated; retry shortly. Returns 422 if its generation failed and 404 if its file is missing; retrying will not help either.
curl https://api.coggno.com/v2/users/user_1/certificates/course_cert_42/download -u API_KEY: -o certificate.pdf
Documents
Documents are the training content created by an LMS admin. Supported types include VideoDocument, ScormDocument, AiccDocument, OfficeDocument, Exam, QuestionBank, and Course.
List documents
/documents
curl https://api.coggno.com/v2/documents -u API_KEY:
{
"object": "list",
"data": [
{
"id": "doc_17",
"object": "document",
"title": "Workplace Safety 101",
"type": "ScormDocument",
"created_at": "2026-04-30T12:00:00Z"
}
]
}
Retrieve a document
/documents/:id
Returns the document details.
Expandable parameters: category, sub_category, modules
curl https://api.coggno.com/v2/documents/doc_17 -u API_KEY:
{
"id": "doc_17",
"object": "document",
"title": "Workplace Safety Course",
"type": "Course",
"created_at": "2026-04-30T12:00:00Z",
"description": "An introduction to workplace safety best practices.",
"category": "cat_3",
"sub_category": "scat_9"
}
Document licenses
List every license held against an admin-created document, across all users in the LMS.
List licenses for a document
/documents/:document_id/licenses
Returns every license held against a document created by an admin, across all users in the LMS. This method does not return licenses for courses bought in the Coggno marketplace.
Expandable parameters: user, document, module_licenses
curl https://api.coggno.com/v2/documents/doc_17/licenses -u API_KEY:
{
"object": "list",
"data": [
{
"id": "lic_1_17",
"object": "license",
"course_license": false,
"document": "doc_17",
"amount": 1,
"used": 1,
"views": 3,
"total_time": 1820,
"score": 87.5,
"passed": true,
"start_date": "2026-05-01T10:00:00Z",
"complete_date": "2026-05-15T14:30:00Z",
"enrollment_date": "2026-04-30T12:00:00Z",
"created_at": "2026-04-30T12:00:00Z",
"user": "user_1"
}
]
}
Marketplace
Courses published in the Coggno marketplace and the categories they are organized in. Use it to get details of the courses your licenses point at - a license’s document id is the course id.
Retrieve a course
/marketplace/courses/:id
Returns a course published in the marketplace, or one your account holds a license for. duration is in minutes and may be null.
Expandable parameters: category, sub_category
curl https://api.coggno.com/v2/marketplace/courses/doc_42 -u API_KEY:
{
"id": "doc_42",
"object": "course",
"title": "Sexual Harassment Prevention for Employees",
"author_name": "Acme Training",
"description": "Learn how to recognize and prevent harassment in the workplace.",
"icon_url": "https://cdn.example.com/42.jpg",
"duration": 60,
"category": "cat_3",
"sub_category": "scat_9"
}
Retrieve a category
/marketplace/categories/:id
Returns a category. Any category id found on a course or sub-category resolves here, including categories no longer shown in the marketplace. Expanded sub_categories include only those shown in the marketplace.
Expandable parameters: sub_categories
curl https://api.coggno.com/v2/marketplace/categories/cat_3 -u API_KEY:
{
"id": "cat_3",
"object": "category",
"title": "Human Resources"
}
Retrieve a sub-category
/marketplace/sub_categories/:id
Returns a sub-category. Any sub-category id found on a course resolves here, including sub-categories no longer shown in the marketplace.
Expandable parameters: category
curl https://api.coggno.com/v2/marketplace/sub_categories/scat_9 -u API_KEY:
{
"id": "scat_9",
"object": "sub_category",
"name": "Harassment Prevention",
"category": "cat_3"
}
Webhooks
Webhooks deliver license lifecycle events to a URL you control. Subscribe by creating a webhook endpoint against a company; Coggno POSTs a JSON payload to your URL each time a subscribed event fires for that company.
The endpoint object
secret_preview is the last few characters of the signing secret, shown for your reference. The full secret is only ever returned once - in the response to the create call. Store it then. The secret can also be viewed on the Settings → Webhooks page.
{
"id": "we_5",
"object": "webhook",
"url": "https://example.com/coggno/webhook",
"events": ["license.completed", "license.failed"],
"enabled": true,
"secret_preview": "…a91f",
"last_attempt_at": "2026-05-15T14:30:00Z",
"last_success_at": "2026-05-15T14:30:00Z",
"consecutive_failures": 0,
"created_at": "2026-05-01T10:00:00Z",
"updated_at": "2026-05-15T14:30:00Z"
}
List webhook endpoints
/companies/:company_id/webhooks
curl https://api.coggno.com/v2/companies/comp_42/webhooks -u API_KEY:
{
"object": "list",
"data": [
{
"id": "we_5",
"object": "webhook",
"url": "https://example.com/coggno/webhook",
"events": ["license.completed"],
"enabled": true,
"secret_preview": "…a91f",
"last_attempt_at": "2026-05-15T14:30:00Z",
"last_success_at": "2026-05-15T14:30:00Z",
"consecutive_failures": 0,
"created_at": "2026-05-01T10:00:00Z",
"updated_at": "2026-05-15T14:30:00Z"
}
]
}
Create a webhook endpoint
/companies/:company_id/webhooks
The signing secret is returned only by this call - store it. Subsequent retrievals return only secret_preview.
Parameters 2
url
events
curl https://api.coggno.com/v2/companies/comp_42/webhooks -u API_KEY: \ -d url=https://example.com/coggno/webhook \ -d events[]=license.completed \ -d events[]=license.failed
{
"id": "we_5",
"object": "webhook",
"url": "https://example.com/coggno/webhook",
"events": ["license.completed", "license.failed"],
"enabled": true,
"secret_preview": "…a91f",
"last_attempt_at": null,
"last_success_at": null,
"consecutive_failures": 0,
"created_at": "2026-05-15T14:30:00Z",
"updated_at": "2026-05-15T14:30:00Z",
"secret": "whsec_5e8b9f1c0d2a4e6f8a91f"
}
Retrieve a webhook endpoint
/companies/:company_id/webhooks/:id
curl https://api.coggno.com/v2/companies/comp_42/webhooks/we_5 -u API_KEY:
Update a webhook endpoint
/companies/:company_id/webhooks/:id
Only the fields you pass are changed. Re-enabling a previously-disabled endpoint immediately dispatches any deliveries that were queued while it was disabled.
Parameters 3
url
events
enabled
curl -X PATCH https://api.coggno.com/v2/companies/comp_42/webhooks/we_5 -u API_KEY: \ -d enabled=true
Delete a webhook endpoint
/companies/:company_id/webhooks/:id
curl -X DELETE https://api.coggno.com/v2/companies/comp_42/webhooks/we_5 -u API_KEY:
{
"id": "we_5",
"object": "webhook",
"deleted": true
}
Webhook events
Subscribe by listing event types in the events array when creating or updating an endpoint. If events is empty or omitted on create, the endpoint receives every type. Coggno only fires top-level license events.
| Event | When it fires |
|---|---|
| license.issued | A license is created for a user (e.g. after a purchase or admin assignment). |
| license.started | The first time the user opens the training and the license’s start_date is set. |
| license.completed | The user passes the training. The payload’s passed flag is true. |
| license.failed | The user fails the training (e.g. fails an exam). |
Webhook payload
Every delivery has the same envelope: a set of X-Coggno-* headers plus a JSON body. Your endpoint must respond with any 2xx status to acknowledge receipt - any non-2xx response, or a network error, counts as a failed delivery.
POST /coggno/webhook HTTP/1.1 Host: example.com Content-Type: application/json User-Agent: Coggno-Webhooks/1.0 X-Coggno-Event: license.completed X-Coggno-Delivery-Id: <uuid> X-Coggno-Signature: t=1747322400,v1=5d3b9a7c… { "id": "<uuid>", "type": "license.completed", "created": "2026-05-15T14:30:00Z", "data": { "user": { "id": "user_12345", "first_name": "John", "last_name": "Doe", "username": "jdoe" }, "license": { "id": "lic_12345_17", "object": "license", "document": { "id": "doc_17", "object": "document", "title": "Workplace Safety 101", "type": "ScormDocument" }, "amount": 1, "used": 1, "views": 3, "total_time": 1820, "score": 87.5, "passed": true, "start_date": "2026-05-01T10:00:00Z", "complete_date": "2026-05-15T14:30:00Z", "enrollment_date": "2026-04-30T12:00:00Z", "created_at": "2026-04-30T12:00:00Z" } } }
Verifying a webhook
Every request carries an X-Coggno-Signature header of the form t=<unix_timestamp>,v1=<hex_hmac_sha256>. The signed string is the timestamp, a literal period, and the raw request body: signed = "<timestamp>.<raw_body>".
To verify: parse t and v1 out of the header; reject if t is more than 5 minutes (300 seconds) off your clock; recompute the HMAC-SHA256 using the endpoint’s signing secret; compare to v1 in constant time. Reject if anything fails.
import hmac, hashlib, time
def verify_coggno_webhook(secret, raw_body, header, tolerance=300):
parts = dict(p.split('=', 1) for p in header.split(',') if '=' in p)
t = int(parts.get('t', '0'))
v1 = parts.get('v1', '')
if t == 0 or not v1:
return False
if abs(int(time.time()) - t) > tolerance:
return False
signed = f"{t}.{raw_body}".encode()
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, v1)
Retries
If your endpoint returns a non-2xx response or times out, Coggno retries the delivery up to 8 times total (the initial attempt plus 7 retries) with polynomial backoff. After the 8th failed attempt the delivery is marked failed. The consecutive_failures counter increments on failure; a single successful delivery resets it to zero.
| Retry | Time interval |
|---|---|
| 1 | ~3 s |
| 2 | ~18 s |
| 3 | ~1.5 min |
| 4 | ~4 min |
| 5 | ~10 min |
| 6 | ~20 min |
| 7 | ~40 min |
Auto-disabling on persistent failure
Coggno automatically disables an endpoint that has been failing for an extended period - specifically when consecutive_failures has reached 64 and the endpoint has not had a successful delivery in the last 3 days (or has never had one). When auto-disabled, deliveries stop and Coggno notifies the account owner by email.
Changelog
Versions
| Version | Date | Changes |
|---|---|---|
| 2.3 | 2026-11-12 | Added user certificates - GET /users/:user_id/certificates, GET /users/:user_id/certificates/:id and GET /users/:user_id/certificates/:id/download. POST /users/:user_id/licenses and POST /groups/:group_id/licenses use your Coggno Prime subscription as a source and accept due_days and recert_interval. |
| 2.2 | 2026-10-23 | Added GET /licenses/owned (the account’s licenses with seat counts), GET /marketplace/courses/:id (marketplace course details), GET /marketplace/categories/:id and GET /marketplace/sub_categories/:id. |
| 2.1 | 2026-06-11 | Added license distribution and reset - POST /users/:user_id/licenses, DELETE /users/:user_id/licenses/:document_id, POST /groups/:group_id/licenses, GET and DELETE /groups/:group_id/licenses/:document_id. Users can be created without a password. Responses include created_at. GET /users/:user_id/licenses/:document_id returns a single license instead of a list. |
| 2.0 | 2026-05-20 | First release of API v2 - companies, webhooks, groups, group users, users, user licenses (list, retrieve, launch URL), documents and document licenses. |
