WhagonsDocs
External API

API Reference

Endpoint-by-endpoint reference for the current Whagons v1 External API.

The External API is the API exposed by keys created in Settings → Integrations → API Keys.

Base URL: https://cvx-share.whagons.com/api/v1
OpenAPI:  https://docs.whagons.com/openapi/whagons-v1.json

New integrations should use /api/v1/*. The production gateway also serves /api/ext/* as compatibility aliases for existing integrations.

Authentication and scopes

Send a Settings-issued key in either header form:

X-API-Key: whg_live_...
Authorization: Bearer whg_live_...
ScopeAllows
ext:readReference-data, task, comment, assignment, tag, and log reads.
ext:tasks:writeTask creation and mutation, comments, assignments, tags, approval decisions, and acknowledgments.

Keys currently receive both scopes when created in Settings. Every API-key call acts as the user who created the key and is evaluated against that user's current tenant permissions, teams, workspace visibility, and task access.

Endpoint index

MethodPathScopeResult
GET/me/tenantsuser sessionTenants for a signed-in first-party user. API keys are not accepted.
GET/workspacesext:readVisible active workspaces.
GET/spotsext:readVisible physical locations.
GET/usersext:readVisible active users.
GET/categoriesext:readTask types/categories.
GET/statusesext:readTask statuses.
GET/prioritiesext:readTask priorities.
GET/teamsext:readTeams.
GET/templatesext:readTask templates.
GET/tagsext:readTags.
GET/tasksext:readA visible task or a filtered task list.
POST/tasksext:tasks:writeA newly created task identity.
PATCH/tasksext:tasks:writeThe updated task identity.
DELETE/tasksext:tasks:writeSoft-delete confirmation.
GET, POST/task-commentsread / writeTask notes and attachment notes.
GET, POST/task-assignmentsread / writeCurrent assignees or the assignment delta.
GET, POST/task-tagsread / writeCurrent tags or the tag delta.
GET/task-logsext:readNewest-first task history.
POST/task-approvalext:tasks:writeApproval or rejection result.
POST/task-acknowledgmentext:tasks:writeAcknowledgment result.

Paths in the sections below are relative to the v1 base URL.

Request conventions

  • tenantId is required on every API-key request. On reads it is a query parameter; on writes it is in the JSON body.
  • tenantId must exactly match the tenant attached to the key.
  • Resource IDs are opaque Convex IDs. Read them from Whagons instead of constructing them.
  • Dates such as dueDate and startDate are Unix timestamps in milliseconds.
  • Request bodies use Content-Type: application/json.
  • List endpoints currently return JSON arrays directly; responses are not wrapped in a data envelope.
  • There is not yet a cursor-pagination contract. GET /tasks instead accepts a bounded limit.

Session

GET /me/tenants

Lists tenants for the signed-in first-party Whagons user. This route uses the product's user session and does not accept a tenant API key. Server-to-server integrations normally already know their tenantId and do not need this endpoint.

Reference data

All reference-data calls require tenantId and ext:read. They return arrays of Whagons row objects. Common fields include _id, _creationTime, tenantId, name, and an optional legacy pgId; each resource can include additional configuration fields.

EndpointOptional filtersIntegration use
GET /workspacesUse _id as workspaceId. Only active, visible workspaces are returned.
GET /spotsUse _id as spotId.
GET /usersUse _id in userIds, assignedTo, or reporting fields. Only active users are returned.
GET /categoriesworkspaceIdUse _id as categoryId. Categories are the task types configured by the tenant.
GET /statusescategoryIdUse _id as statusId. Filter by category whenever possible.
GET /prioritiescategoryIdUse _id as priorityId.
GET /teamsUse _id as teamId or reportedByTeamId.
GET /templatesworkspaceId, categoryIdUse _id as templateId. Both filters may be combined.
GET /tagsUse _id with /task-tags.

Example:

curl --request GET \
  --url 'https://cvx-share.whagons.com/api/v1/workspaces?tenantId=hotel-1' \
  --header 'X-API-Key: whg_live_REPLACE_ME'

Tasks

GET /tasks

With taskId or pgId, returns one visible task object. Without either identity, returns a newest-first array of visible tasks.

Query parameterRequiredBehavior
tenantIdyesTenant attached to the key.
taskIdnoFetch one task by its current opaque ID. Takes the detail path when present.
pgIdnoFetch one task by its legacy numeric ID.
workspaceIdnoMatch one workspace.
categoryIdnoMatch one task type/category.
statusIdnoMatch one status.
priorityIdnoMatch one priority.
teamIdnoMatch the owning team.
spotIdnoMatch a location.
templateIdnoMatch a task template.
assignedTonoUse me for the key creator or supply a Whagons user ID.
assignedToMenotrue is equivalent to assignedTo=me.
searchnoCase-insensitive match against task name or description.
limitnoInteger from 1 to 500; defaults to 100. Values are clamped to that range.

Task visibility is applied after filters. A caller never receives tasks outside the key creator's current permissions.

POST /tasks

Creates a task and optionally assigns users.

JSON fieldTypeRequiredNotes
tenantIdstringyesTenant attached to the key.
namestringyesHuman-readable task title.
workspaceIdstringyesID from /workspaces.
descriptionstringnoTask details.
categoryIdstringnoID from /categories.
teamIdstringnoOwning team ID.
templateIdstringnoTemplate ID.
spotIdstringnoPhysical location ID.
statusIdstringnoInitial status ID.
priorityIdstringnoPriority ID.
slaIdstringnoSLA ID when that configuration is known to the integration.
dueDatenumbernoEpoch milliseconds.
startDatenumbernoEpoch milliseconds.
latitude, longitudenumbernoOptional coordinates.
reportedByTeamIdstringnoReporting-team context.
reportedByUserIdstringnoReporting-user context.
userIdsstring[]noUsers to assign during creation.

Minimal body:

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

Response:

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

pgId can be null or absent when no legacy numeric identity exists.

PATCH /tasks

Requires tenantId and taskId. Put changes in updates, or send the same update fields at the top level. When updates is present, it is used as the update source.

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

Allowed fields are name, description, statusId, priorityId, teamId, spotId, categoryId, templateId, dueDate, startDate, latitude, and longitude. Nullable fields can be sent as null to clear them. Unknown fields are ignored by the current handler.

The result includes taskId. Status changes and field updates still pass normal workflow, team, approval-lock, and field-permission checks.

DELETE /tasks

Soft-deletes a task. Send both identifiers as query parameters:

DELETE /tasks?tenantId=hotel-1&taskId=j97...

The handler also accepts the identifiers in a JSON body for compatibility. A successful response is:

{
  "ok": true,
  "taskId": "j97..."
}

Task subresources

Every read below requires tenantId and taskId as query parameters. Every write requires them in the JSON body. The task must be visible to the key creator.

Comments and attachment notes

GET /task-comments returns task notes from oldest to newest.

POST /task-comments accepts:

FieldRequiredNotes
tenantId, taskIdyesTask identity.
notenoComment text.
sourcenocomment by default, or task_attachment.
attachmentsnoArray of { storageId, fileName, fileSize, fileType }. Storage IDs must already be valid.
mentionedUserIdsnoArray of user IDs referenced by the note.

The response contains the new note id and taskId.

Assignments

GET /task-assignments returns the task's assignment rows.

POST /task-assignments requires a non-empty userIds array. mode is set by default and can be add or remove. The response contains taskId, plus added and removed user-ID arrays.

Set replaces the complete assignment set

Use add or remove when another person or integration may be changing assignments concurrently. An assignment request cannot use an empty userIds array.

Tags

GET /task-tags returns the task's tag-link rows.

POST /task-tags accepts tagIds and a mode of set (default), add, or remove. Unlike assignments, tagIds may be empty; mode: "set" with an empty array clears all tags. The response contains taskId, added, and removed tag-ID arrays.

Logs

GET /task-logs returns task log rows newest first. Logs reflect changes made in both Whagons and the External API.

Approval decisions

POST /task-approval requires decision: "approved" | "rejected" and accepts optional contextId, comment, and signatureStorageId.

{
  "tenantId": "hotel-1",
  "taskId": "j97...",
  "contextId": "workspace-context-id",
  "decision": "approved",
  "comment": "Reviewed and approved"
}

Approvals belong to a workspace context on the source task. They are not duplicated action tasks. Omit contextId only when the intended context is unambiguous.

Acknowledgments

POST /task-acknowledgment accepts optional contextId and comment:

{
  "tenantId": "hotel-1",
  "taskId": "j97...",
  "contextId": "workspace-context-id",
  "comment": "Acknowledged"
}

OpenAPI

The versioned, machine-readable description is available at /openapi/whagons-v1.json. It can be imported into API clients, code generators, or testing tools.

The prose guide is the operational source for permission and workflow behavior; OpenAPI is the request-and-response contract. Changes to either are recorded in the API changelog.

Compatibility routes

The same handlers remain available at /api/ext/*. New clients should use /api/v1/*, and existing clients should follow the migration guide.

On this page