# POST /training-canvases/:id/cards

**Resource:** [Learning Hub](./training.md)  
**Scopes:** `resources:write`  
**Write operation:** yes

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)

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | uuid | yes | Canvas UUID |
| `resource_type` | body | string | yes | One of: notepad, youtube, link, html_embed, document, image, file |
| `title` | body | string | yes | Card title |
| `url` | body | string | yes | Entity UUID (for notepad/document/image/file) or full URL (for youtube/link/html_embed) |
| `description` | body | string | no | Optional card description |
| `category` | body | string | no | training, sales, policy, reference, or general (default) |
| `position` | body | number | no | Sort order (0-based, default 0) |
| `display_config` | body | object | no | Grid layout: { layout: { lg: { x, y, w, h }, md, sm, xs } } |

## Response example

```json
{
  "request": {
    "title": "Onboarding PDF",
    "resource_type": "document",
    "url": "<crm_documents.id>",
    "description": "Read before your first day",
    "category": "training",
    "position": 0
  },
  "response": {
    "data": {
      "id": "uuid",
      "canvas_id": "uuid",
      "company_id": "uuid",
      "title": "Onboarding PDF",
      "resource_type": "document",
      "url": "<crm_documents.id>",
      "description": "Read before your first day",
      "category": "training",
      "sort_order": 0,
      "display_config": {}
    }
  }
}
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`