---
title: "Create or link a project per course and a to-do per assignment; safe to repeat"
method: POST
path: "/integration/canvas/import"
tags: ["canvas-import"]
---

# Create or link a project per course and a to-do per assignment; safe to repeat

`POST /integration/canvas/import`

## Request

- Base URL: `https://api.focusbear.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.focusbear.io/integration/canvas/import`
- Auth: HTTP bearer

Re-imports never duplicate a project or to-do and never undo the student’s edits, completions or deletions. With generate_subtasks, new to-dos get an AI breakdown.

## Request body

- CanvasImportDto
  - `courses` CanvasCourseImportDto[], required
    - `decision` 'auto' | 'use_existing' | 'create', required
    - `assignments` CanvasAssignmentInputDto[], required
      - `uid` string, required: The event UID (`event-assignment-<id>`): stable across feed refreshes, so it keys the to-do.
      - `title` string, required: The title without Canvas's "[COURSE]" suffix.
      - `details` string, required: The to-do's details as the app writes them: the description's start, then the link back to Canvas.
      - `due_day` string, required: Due dates are day-granular in the apps, so an assignment's due date arrives as a day.
      - `description_excerpt` string: The start of Canvas's description, given to the AI breakdown alongside the title. The app chooses what to share; the server cuts it to the breakdown prompt's input limit.
      - `previously_imported` boolean: This device imported the assignment before (its own record of the client-side import that preceded this endpoint). A to-do that is gone then was deleted by the student and must not come back.
    - `project_id` string, uuid: Required with `use_existing`: one of the student's own active projects.
    - `course_id` string, required: Canvas's course id (from `/courses/<id>` in the event link), or whatever named the course.
    - `name` string, required: The name the course's project gets: its code ("COMP1010") or Canvas's category.
  - `generate_subtasks` boolean, required: Break each newly imported assignment into subtasks with AI. Off unless the student turned it on: the assignment's title and the start of its description go to the AI provider.
  - `language` string: The language subtasks are written in (`en`, `es`, … or a name); English when absent or unknown.
  - `feed_host` string, required: The school's Canvas host, e.g. `school.instructure.com`.

## Response `200`

- CanvasImportResponseDto
  - `courses` CanvasCourseResultDto[], required
    - `course_id` string, required
    - `project_id` object, nullable
    - `project_name` object, nullable
    - `outcome` 'linked' | 'adopted' | 'created' | 'skipped_deleted' | 'failed', required
  - `tasks` CanvasTaskResultDto[], required
    - `uid` string, required
    - `todo_id` string, required
    - `outcome` 'created' | 'updated' | 'unchanged' | 'skipped_deleted' | 'skipped_course' | 'failed', required
    - `subtasks` CanvasGeneratedSubtaskDto[], required: The AI breakdown stored on a to-do this import created; empty otherwise.
      - `name` string, required
      - `estimated_minutes` object, nullable

---

[API](https://skmtc.dev/focusbear/apis/focusbear-api.md) - [All operations](https://skmtc.dev/focusbear/apis/focusbear-api/llms.txt) - [OpenAPI document](https://skmtc.dev/focusbear/apis/focusbear-api/revisions/3a83a3b9a811?raw)
