WhagonsDocs
External API

Tasks

How external systems create, read, update, delete, and act on tasks in Whagons.

External task operations use the same visibility, permission, and workflow policy as product workflows. API keys act as the user who created the key.

Minimal Task

{
  "tenantId": "hotel-1",
  "name": "Inspect room 304",
  "workspaceId": "j57..."
}

Required fields:

FieldDescription
tenantIdTenant identifier for the task.
nameHuman-readable task title.
workspaceIdConvex workspace ID from GET /api/v1/workspaces.

Optional Assignments

Add userIds to assign users at creation time:

{
  "tenantId": "hotel-1",
  "name": "Deliver crib to room 512",
  "workspaceId": "j57...",
  "userIds": ["k97...", "n42..."]
}

Optional Location

Add spotId to attach a physical location:

{
  "tenantId": "hotel-1",
  "name": "Check pool towels",
  "workspaceId": "j57...",
  "spotId": "m22..."
}

Optional Task Metadata

Task creation also accepts optional Convex IDs returned from reference endpoints:

FieldSource
categoryIdGET /api/v1/categories
teamIdGET /api/v1/teams
templateIdGET /api/v1/templates
statusIdGET /api/v1/statuses
priorityIdGET /api/v1/priorities
slaIdInternal SLA configuration, when exposed to the integration.
dueDateUnix timestamp in milliseconds.
startDateUnix timestamp in milliseconds.
latitude / longitudeOptional coordinates.
reportedByTeamId / reportedByUserIdReporting context, when allowed by task policy.

Response

{
  "id": "j97...",
  "pgId": 1234
}

Use id for future Convex-native references. pgId is returned when a legacy numeric identifier exists.

Read Tasks

GET /api/v1/tasks?tenantId=<tenant-id>&limit=100

Supported filters:

QueryDescription
taskIdFetch one visible task by Convex ID.
pgIdFetch one visible task by legacy numeric ID.
workspaceIdFilter by workspace.
statusIdFilter by status.
priorityIdFilter by priority.
categoryIdFilter by category/task type.
teamIdFilter by team.
spotIdFilter by spot/location.
templateIdFilter by template.
assignedTo=meTasks assigned to the API-key creator.
assignedTo=<userId>Tasks assigned to a specific user.
searchCase-insensitive match against task name and description.
limitMaximum rows from 1 to 500; defaults to 100 and is clamped by the server.

Only tasks visible to the key creator are returned.

Update a Task

PATCH /api/v1/tasks
{
  "tenantId": "hotel-1",
  "taskId": "j97...",
  "updates": {
    "description": "Updated from automation",
    "statusId": "s12...",
    "priorityId": "p34..."
  }
}

Allowed update fields are name, description, statusId, priorityId, teamId, spotId, categoryId, templateId, dueDate, startDate, latitude, and longitude.

Status changes require normal status-change permission, owning-team access, and workflow validity. Fields can also be restricted by field-permission policy.

Delete a Task

DELETE /api/v1/tasks?tenantId=<tenant-id>&taskId=<task-id>

This soft-deletes a visible task and requires delete-task permission.

Comments and Attachments

List comments:

GET /api/v1/task-comments?tenantId=<tenant-id>&taskId=<task-id>

Create a comment:

POST /api/v1/task-comments
{
  "tenantId": "hotel-1",
  "taskId": "j97...",
  "note": "Comment from automation"
}

The same endpoint accepts source: "task_attachment" and an attachments array when the integration already has valid storage IDs.

Assignments

GET /api/v1/task-assignments?tenantId=<tenant-id>&taskId=<task-id>
POST /api/v1/task-assignments
{
  "tenantId": "hotel-1",
  "taskId": "j97...",
  "mode": "add",
  "userIds": ["u12..."]
}

mode can be set, add, or remove.

Tags

GET /api/v1/task-tags?tenantId=<tenant-id>&taskId=<task-id>
POST /api/v1/task-tags
{
  "tenantId": "hotel-1",
  "taskId": "j97...",
  "mode": "add",
  "tagIds": ["t12..."]
}

mode can be set, add, or remove.

Logs

GET /api/v1/task-logs?tenantId=<tenant-id>&taskId=<task-id>

Returns task logs visible to the key creator.

Approval and Acknowledgment Actions

Approve or reject a visible approval context:

POST /api/v1/task-approval
{
  "tenantId": "hotel-1",
  "taskId": "j97...",
  "contextId": "optional-context-id",
  "decision": "approved",
  "comment": "Looks good"
}

Acknowledge a visible acknowledgment context:

POST /api/v1/task-acknowledgment
{
  "tenantId": "hotel-1",
  "taskId": "j97...",
  "contextId": "optional-context-id",
  "comment": "Acknowledged"
}

Implementation Notes

  • API-key task creation records the key creator as the acting user.
  • Task reads and writes are permission-checked as that creator.
  • Optional fields can be added in v1 when they are backward compatible.
  • Invalid JSON or missing required fields returns 400.
  • Missing, invalid, expired, inactive, wrong-tenant, or under-scoped credentials return 401.

On this page