External API
Examples
End-to-end cURL examples for the Whagons External API.
Set common environment variables:
export WHAGONS_API_BASE="https://cvx-share.whagons.com/api/v1"
export WHAGONS_TENANT_ID="<tenant-id>"
export WHAGONS_API_KEY="<api-key>"This is the production HTTP action gateway. Each example also supplies a tenantId that must match the tenant attached to the credential.
List Workspaces
curl "$WHAGONS_API_BASE/workspaces?tenantId=$WHAGONS_TENANT_ID" \
-H "X-API-Key: $WHAGONS_API_KEY"List Spots
curl "$WHAGONS_API_BASE/spots?tenantId=$WHAGONS_TENANT_ID" \
-H "X-API-Key: $WHAGONS_API_KEY"List Users
curl "$WHAGONS_API_BASE/users?tenantId=$WHAGONS_TENANT_ID" \
-H "X-API-Key: $WHAGONS_API_KEY"List Statuses for a Category
curl "$WHAGONS_API_BASE/statuses?tenantId=$WHAGONS_TENANT_ID&categoryId=<category-id>" \
-H "X-API-Key: $WHAGONS_API_KEY"Create a Minimal Task
curl -X POST "$WHAGONS_API_BASE/tasks" \
-H "Content-Type: application/json" \
-H "X-API-Key: $WHAGONS_API_KEY" \
-d '{
"tenantId": "<tenant-id>",
"name": "Inspect room 304",
"workspaceId": "<workspace-id>"
}'Create a Task With Assignments and Location
curl -X POST "$WHAGONS_API_BASE/tasks" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer '"$WHAGONS_API_KEY"'" \
-d '{
"tenantId": "<tenant-id>",
"name": "Deliver crib to room 512",
"workspaceId": "<workspace-id>",
"description": "Guest requested delivery before 6 PM.",
"spotId": "<spot-id>",
"userIds": ["<user-id>"]
}'List Recent Visible Tasks
curl "$WHAGONS_API_BASE/tasks?tenantId=$WHAGONS_TENANT_ID&limit=25" \
-H "X-API-Key: $WHAGONS_API_KEY"Fetch One Task
curl "$WHAGONS_API_BASE/tasks?tenantId=$WHAGONS_TENANT_ID&taskId=<task-id>" \
-H "X-API-Key: $WHAGONS_API_KEY"Use pgId=<numeric-id> instead of taskId when an integration only stores the legacy numeric task ID.
Update a Task
curl -X PATCH "$WHAGONS_API_BASE/tasks" \
-H "Content-Type: application/json" \
-H "X-API-Key: $WHAGONS_API_KEY" \
-d '{
"tenantId": "<tenant-id>",
"taskId": "<task-id>",
"updates": {
"description": "Guest requested delivery before 5 PM.",
"priorityId": "<priority-id>"
}
}'Add a Comment
curl -X POST "$WHAGONS_API_BASE/task-comments" \
-H "Content-Type: application/json" \
-H "X-API-Key: $WHAGONS_API_KEY" \
-d '{
"tenantId": "<tenant-id>",
"taskId": "<task-id>",
"note": "Confirmed with housekeeping."
}'Replace Assignees
curl -X POST "$WHAGONS_API_BASE/task-assignments" \
-H "Content-Type: application/json" \
-H "X-API-Key: $WHAGONS_API_KEY" \
-d '{
"tenantId": "<tenant-id>",
"taskId": "<task-id>",
"mode": "set",
"userIds": ["<user-id>"]
}'Add Tags
curl -X POST "$WHAGONS_API_BASE/task-tags" \
-H "Content-Type: application/json" \
-H "X-API-Key: $WHAGONS_API_KEY" \
-d '{
"tenantId": "<tenant-id>",
"taskId": "<task-id>",
"mode": "add",
"tagIds": ["<tag-id>"]
}'Delete a Task
Only run delete examples in a safe tenant or sandbox.
curl -X DELETE "$WHAGONS_API_BASE/tasks?tenantId=$WHAGONS_TENANT_ID&taskId=<task-id>" \
-H "X-API-Key: $WHAGONS_API_KEY"Handle Unauthorized
curl "$WHAGONS_API_BASE/workspaces?tenantId=$WHAGONS_TENANT_ID" \
-H "X-API-Key: bad-key"Expected shape:
{
"error": "Unauthorized"
}