Pular para o conteúdo
CognizyCognizyAjuda
Entrar
Nesta área

Tasks

Manage task boards, tasks, checklists, labels and assignees.

List task boards

get/v1/public/task-boards

Returns all task boards in the organization with their columns, members, and task count.

Parâmetros

Sem parâmetros.

Respostas

  • 200

Exemplos

bash
curl -X GET "https://api.cognizy.ai/api/v1/public/task-boards" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Get a task board

get/v1/public/task-boards/{id}

Returns a single board with columns, tasks nested per column, labels, and members. Use list_tasks below to query tasks with filters and pagination instead of pulling the full board.

Parâmetros

idstringobrigatório· caminho
Task board ID

Respostas

  • 200Task board returned
  • 404Task board not found

Exemplos

bash
curl -X GET "https://api.cognizy.ai/api/v1/public/task-boards/<id>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

List tasks in a board

get/v1/public/task-boards/{id}/tasks

Paginated tasks within a board, with composable filters: column, assignee, label, overdue, completed.

Parâmetros

idstringobrigatório· caminho
Task board ID
limitnumberopcional· consulta
Range 1–100
pagenumberopcional· consulta
completedbooleanopcional· consulta
true = only completed; false = only uncompleted; omit for both
overduebooleanopcional· consulta
true = only tasks past their dueDate and not completed
labelIdstringopcional· consulta
assigneeIdstringopcional· consulta
columnIdstringopcional· consulta

Respostas

  • 200

Exemplos

bash
curl -X GET "https://api.cognizy.ai/api/v1/public/task-boards/<id>/tasks" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Create a task in a board

post/v1/public/task-boards/{id}/tasks

Aceita Idempotency-Key

Creates a new task in a specific column of a board. Most fields are optional; only title and columnId are required. Defaults to aiGenerated: true when called via the public API (overrideable in body) so the dashboard surfaces tasks that came from MCP/integrations distinctly from human-created ones. Returns the full task row with assignees, labels, counts.

Parâmetros

idstringobrigatório· caminho
Task board ID

Corpo (JSON)obrigatório

titlestringobrigatório
columnIdstringobrigatório
Target column ID within this board
descriptionstringopcional
prioritystringopcional
LOWMEDIUMHIGHURGENT
dueDatestring (date-time)opcional
ISO datetime
estimatedMinutesintegeropcional
assigneeIdsstring[]opcional
labelIdsstring[]opcional
conversationIdstringopcional
contactIdstringopcional
aiGeneratedbooleanopcional
Defaults to true via public API
aiReasonstringopcional
parentIdstringopcional
Parent task ID (for subtasks)

Respostas

  • 201Task created
  • 400Invalid task payload
  • 404Board, column, assignee, or label not found

Exemplos

bash
curl -X POST "https://api.cognizy.ai/api/v1/public/task-boards/<id>/tasks" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "title": "texto",
  "columnId": "column_123",
  "description": "texto",
  "priority": "LOW",
  "dueDate": "2026-11-12T14:00:00.000Z",
  "estimatedMinutes": 0,
  "assigneeIds": [
    "assignee_123"
  ],
  "labelIds": [
    "label_123"
  ],
  "conversationId": "conversation_123",
  "contactId": "contact_123",
  "aiGenerated": true,
  "aiReason": "texto",
  "parentId": "parent_123"
}'

Get a task by id

get/v1/public/tasks/{id}

Returns the full task: description, checklist, subtasks, recent activities (50), assignees, labels, linked conversation/contact.

Parâmetros

idstringobrigatório· caminho
Task ID

Respostas

  • 200Task returned
  • 404Task not found

Exemplos

bash
curl -X GET "https://api.cognizy.ai/api/v1/public/tasks/<id>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Update task fields

patch/v1/public/tasks/{id}

Aceita Idempotency-Key

Partial update of task fields (title, description, priority, dueDate, estimatedMinutes). Pass dueDate: null to clear it. Other omitted fields are left untouched. Triggers PRIORITY_CHANGED / DUE_DATE_CHANGED / UPDATED activity entries as applicable.

Parâmetros

idstringobrigatório· caminho
Task ID

Corpo (JSON)obrigatório

titlestringopcional
descriptionstringopcional
prioritystringopcional
LOWMEDIUMHIGHURGENT
dueDatestring (date-time)opcional
estimatedMinutesintegeropcional

Respostas

  • 200Task updated
  • 400Invalid patch payload
  • 404Task not found

Exemplos

bash
curl -X PATCH "https://api.cognizy.ai/api/v1/public/tasks/<id>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "title": "texto",
  "description": "texto",
  "priority": "LOW",
  "dueDate": "2026-11-12T14:00:00.000Z",
  "estimatedMinutes": 0
}'

Delete a task

delete/v1/public/tasks/{id}

Removes a task entirely. Cascades to comments, checklist items, attachments, and subtasks. Idempotent — succeeds with 204 even if the task was already gone or never belonged to your org (cross-tenant ids are not revealed).

Parâmetros

idstringobrigatório· caminho
Task ID

Respostas

  • 204Task deleted (or already gone — idempotent)

Exemplos

bash
curl -X DELETE "https://api.cognizy.ai/api/v1/public/tasks/<id>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Add a comment to a task

post/v1/public/tasks/{id}/comments

Aceita Idempotency-Key

Posts a comment authored by the user who created the API key (or the org owner as fallback). Triggers the same notifications and activity log entry as an in-app comment. Use this from MCP/external agents to surface findings on tasks ("AI detected this ticket is at-risk", "Suggested fix: X").

Parâmetros

idstringobrigatório· caminho
Task ID

Corpo (JSON)obrigatório

contentstringobrigatório
Comment body
parentIdstringopcional
Parent comment ID for threaded replies

Respostas

  • 201Comment created
  • 400Invalid content or parentId
  • 404Task not found

Exemplos

bash
curl -X POST "https://api.cognizy.ai/api/v1/public/tasks/<id>/comments" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "content": "texto",
  "parentId": "parent_123"
}'

Add a checklist item to a task

post/v1/public/tasks/{id}/checklist

Aceita Idempotency-Key

Appends a new checklist item at the end of the task's checklist. Triggers a CHECKLIST_ITEM_ADDED activity entry.

Parâmetros

idstringobrigatório· caminho
Task ID

Corpo (JSON)obrigatório

titlestringobrigatório
Checklist item title

Respostas

  • 201Checklist item created
  • 400Invalid title
  • 404Task not found

Exemplos

bash
curl -X POST "https://api.cognizy.ai/api/v1/public/tasks/<id>/checklist" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "title": "texto"
}'

Toggle a checklist item completion

post/v1/public/tasks/{id}/checklist/{itemId}/toggle

Aceita Idempotency-Key

Flips completed on/off. Adding done: true would let the caller force-set instead of toggle, but toggle is simpler and mirrors the in-app UI button. Triggers CHECKLIST_ITEM_COMPLETED activity when completing.

Parâmetros

idstringobrigatório· caminho
Task ID
itemIdstringobrigatório· caminho
Checklist item ID

Respostas

  • 200Checklist item toggled
  • 404Task or checklist item not found

Exemplos

bash
curl -X POST "https://api.cognizy.ai/api/v1/public/tasks/<id>/checklist/<itemId>/toggle" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Delete a checklist item

delete/v1/public/tasks/{id}/checklist/{itemId}

Parâmetros

idstringobrigatório· caminho
Task ID
itemIdstringobrigatório· caminho
Checklist item ID

Respostas

  • 204Checklist item deleted
  • 404Task or checklist item not found

Exemplos

bash
curl -X DELETE "https://api.cognizy.ai/api/v1/public/tasks/<id>/checklist/<itemId>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Attach a label to a task

post/v1/public/tasks/{id}/labels/{labelId}

Aceita Idempotency-Key

Verifies the label belongs to the caller's org before attaching. Idempotent at the data layer via PK constraint — re-attach raises Prisma P2002 which we swallow.

Parâmetros

idstringobrigatório· caminho
Task ID
labelIdstringobrigatório· caminho
Label ID to attach

Respostas

  • 204Label attached (or already attached — idempotent)
  • 404Task or label not found

Exemplos

bash
curl -X POST "https://api.cognizy.ai/api/v1/public/tasks/<id>/labels/<labelId>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Detach a label from a task

delete/v1/public/tasks/{id}/labels/{labelId}

Parâmetros

idstringobrigatório· caminho
Task ID
labelIdstringobrigatório· caminho
Label ID to detach

Respostas

  • 204Label detached (or was not attached — idempotent)
  • 404Task or label not found

Exemplos

bash
curl -X DELETE "https://api.cognizy.ai/api/v1/public/tasks/<id>/labels/<labelId>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Move a task to a different column / position

post/v1/public/tasks/{id}/move

Aceita Idempotency-Key

Move within the same board. The target column must belong to the task's current board (TaskService enforces this). Pass position as a 0-based index in the destination column. Triggers MOVED activity entry; auto-sets completedAt / archivedAt when the target column has those flags.

Parâmetros

idstringobrigatório· caminho
Task ID

Corpo (JSON)obrigatório

columnIdstringobrigatório
Destination column ID (same board)
positionintegerobrigatório
0-based index in the destination column

Respostas

  • 200Task moved
  • 400Invalid columnId or position
  • 404Task or column not found

Exemplos

bash
curl -X POST "https://api.cognizy.ai/api/v1/public/tasks/<id>/move" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "columnId": "column_123",
  "position": 0
}'

Assign a user to a task

post/v1/public/tasks/{id}/assignees/{userId}

Aceita Idempotency-Key

Idempotent — re-assigning the same user is treated as success (TaskService raises BadRequestException for duplicates; we map that to 204). The user must be a member of the same org. Sends an in-app notification to the new assignee.

Parâmetros

idstringobrigatório· caminho
Task ID
userIdstringobrigatório· caminho
User ID to assign (must be a member of the same org)

Respostas

  • 204User assigned (or already assigned — idempotent)
  • 404Task or user not found in organization

Exemplos

bash
curl -X POST "https://api.cognizy.ai/api/v1/public/tasks/<id>/assignees/<userId>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Unassign a user from a task

delete/v1/public/tasks/{id}/assignees/{userId}

Idempotent — succeeds even if the user wasn't assigned.

Parâmetros

idstringobrigatório· caminho
Task ID
userIdstringobrigatório· caminho
User ID to unassign

Respostas

  • 204User unassigned (or was not assigned — idempotent)
  • 404Task not found

Exemplos

bash
curl -X DELETE "https://api.cognizy.ai/api/v1/public/tasks/<id>/assignees/<userId>" \
  -H "Authorization: Bearer $COGNIZY_API_KEY"

Toda a referência