# Learning Hub

Manage Learning Hub canvases and their cards. Canvases are drag-and-drop boards of cards that can embed YouTube videos, external links, iframes, notepads, PDFs, images, and secure files.

**Base URL:** `https://api.trustpager.com/functions/v1/api/v1`

## Endpoints

### GET /training-canvases

List all Learning Hub canvases. Returns id, name, template, and timestamps. Use GET /training-canvases/:id to retrieve a canvas with its cards.

**Scopes:** `resources:read` — [full detail](./training/get-training-canvases.md)

### GET /training-canvases/:id

Get a single canvas including all cards, sorted by sort_order. Cards include resource_type, url, description, category, and display_config (grid layout).

**Scopes:** `resources:read` — [full detail](./training/get-training-canvases-id.md)

### POST /training-canvases

Create a new Learning Hub canvas. Pass template="getting_started" to seed 6 starter cards automatically.

**Scopes:** `resources:write` — [full detail](./training/post-training-canvases.md)

### PATCH /training-canvases/:id

Rename a Learning Hub canvas.

**Scopes:** `resources:write` — [full detail](./training/patch-training-canvases-id.md)

### DELETE /training-canvases/:id

Delete a canvas and all its cards. This is permanent.

**Scopes:** `resources:delete` — [full detail](./training/delete-training-canvases-id.md)

### POST /training-canvases/:id/cards

Add a card to a canvas. Seven resource_type values are supported:
- notepad: url = company_notepads.id
- youtube: url = full YouTube URL
- link: url = external URL
- html_embed: url = URL to embed in an iframe
- document: url = crm_documents.id (opens EnhancedPDFViewer)
- image: url = company_files.id (must be category=images, opens FilePreviewModal)
- file: url = company_secure_files.id (opens SecureFilePreviewModal)

**Scopes:** `resources:write` — [full detail](./training/post-training-canvases-id-cards.md)

### PATCH /training-cards/:id

Update a Learning Hub card. All fields are optional.

**Scopes:** `resources:write` — [full detail](./training/patch-training-cards-id.md)

### DELETE /training-cards/:id

Remove a card from its canvas. Does not delete the underlying entity (the notepad, document, image, or file still exists).

**Scopes:** `resources:delete` — [full detail](./training/delete-training-cards-id.md)
