Convert a chat message into one or more board-task drafts.
Generates a list of `{ subject, description }` task drafts from a chat message. Used by the chat composer's per-message create-task dropdown ("Generate with Nu" option). The frontend opens the EnhancedTaskCreatorModal in a loading state, calls this endpoint, and seeds the modal's draft list from the `tasks` array. **Compound capability requirement.** Unlike Polish, this endpoint requires BOTH `requireCapability('boards', projectId)` and `requireCapability('ai', workspaceId)`; both `workspaceId` and `projectId` must resolve to an active subscription. Either capability missing returns `capabilityNotAvailable`. **Context window.** `contextMessages` is the preceding chat thread (oldest first). The server caps at 10 messages and each entry's `content` at 8000 characters; supply the messages immediately before the focal one so the model can resolve pronouns and references. **Permission.** Requires `canAiGenerateTasks` (granted to all workspace/project admins via `ai:*`, plus to creator / reviewer / reviewerAdmin role bundles explicitly). **Pre-prompt.** If the workspace or project has `aiTaskGenerationPreprompt` configured, it is appended to the system prompt as an override block (project value wins per-key). Separate from `aiCustomPreprompt` so admins can tune task style without affecting Polish or Chat output. Caps: - `messageText` is capped at 8000 characters. - `contextMessages` is capped at 10 entries; each entry's `content` is capped at 8000 characters and `authorName` at 100. - The LLM is instructed to emit at most 10 tasks; the server also enforces this cap defensively.
Generates a list of { subject, description } task drafts from a
chat message. Used by the chat composer's per-message create-task
dropdown ("Generate with Nu" option). The frontend opens the
EnhancedTaskCreatorModal in a loading state, calls this endpoint,
and seeds the modal's draft list from the tasks array.
Compound capability requirement. Unlike Polish, this endpoint
requires BOTH requireCapability('boards', projectId) and
requireCapability('ai', workspaceId); both workspaceId and
projectId must resolve to an active subscription. Either capability
missing returns capabilityNotAvailable.
Context window. contextMessages is the preceding chat
thread (oldest first). The server caps at 10 messages and each
entry's content at 8000 characters; supply the messages immediately
before the focal one so the model can resolve pronouns and references.
Permission. Requires canAiGenerateTasks (granted to all
workspace/project admins via ai:*, plus to creator / reviewer /
reviewerAdmin role bundles explicitly).
Pre-prompt. If the workspace or project has
aiTaskGenerationPreprompt configured, it is appended to the
system prompt as an override block (project value wins per-key).
Separate from aiCustomPreprompt so admins can tune task style
without affecting Polish or Chat output.
Caps:
messageTextis capped at 8000 characters.contextMessagesis capped at 10 entries; each entry'scontentis capped at 8000 characters andauthorNameat 100.- The LLM is instructed to emit at most 10 tasks; the server also enforces this cap defensively.
OAuth 2.1 authorization code flow with PKCE (required of every client, public or confidential). Scopes are a ceiling on the credential, not a grant of access: a token also cannot exceed what the user who approved it may already do. A write scope does not imply its matching read — ask for both.
In: header
Scope: ai:use
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/ai/task-generation" \ -H "Content-Type: application/json" \ -d '{ "workspaceId": "0193e4a1-b2c3-7000-8000-000000000001", "projectId": "0193e4a1-b2c3-7000-8000-000000000aaa", "messageText": "Draft the launch checklist by Friday." }'{ "tasks": [ { "subject": "Draft launch checklist", "description": "List every step needed before go-live." }, { "subject": "Notify stakeholders", "description": "Email the launch plan to leadership." } ], "billedCredits": 4, "balanceAfter": 9996, "eventId": "0193e4a1-b2c3-7000-8000-00000000abcd"}