Passes — Admin & Bulk
Workspace-level utilities for passes that operate across an entire workspace rather than on a single pass. These complement the standard pass CRUD endpoints (mounted at /wallethero-api/passes) with an aggregate wallet count and a bulk refresh that re-pushes every live wallet pass.
Auth (all endpoints): Bearer token — caller must be a member of the workspace in the path (createWorkspaceGuard).
Aggregate Passes by Wallet
GET /wallethero-api/workspace/:workspaceId/passes/aggregate
Returns workspace-wide pass counts: the total number of passes plus the number of distinct passes registered to an Apple wallet and to a Google wallet. Useful for dashboard summary tiles.
Auth: Bearer token — workspace member (also re-checked via checkWorkspaceAccess).
Path Parameters
| Parameter | Type | Description |
|---|---|---|
workspaceId | string (UUID) | Workspace identifier |
Example Request
curl "https://api.wallethero.app/wallethero-api/workspace/WORKSPACE_ID/passes/aggregate" \
-H "Authorization: Bearer YOUR_TOKEN"Response (200)
{
"data": {
"total": 1420,
"apple": 860,
"google": 540
}
}total is the count of all pass rows in the workspace. apple and google are counts of distinct passes that have at least one registration in the respective wallet, so apple + google may differ from total (a pass can be in both wallets, or in neither).
SDK
const { data } = await wh.passes.aggregateByWallet(workspaceId);
// data: { total, apple, google }Refresh All Passes
POST /wallethero-api/workspace/:workspaceId/passes/refresh-all
Queues a refresh for every live wallet pass in the workspace. The job fans out per pass_template_id and the passserver re-pushes updates to all registered Apple and Google devices. The work is enqueued asynchronously — the response returns immediately and does not wait for the push to complete.
Auth: Bearer token — workspace member.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
workspaceId | string (UUID) | Workspace identifier |
Request Body
None. Send an empty body ({}).
Example Request
curl -X POST "https://api.wallethero.app/wallethero-api/workspace/WORKSPACE_ID/passes/refresh-all" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Response (200)
{
"data": {
"queued": true,
"templateCount": 7
}
}queued is always true once the job is enqueued. templateCount is the number of distinct pass_template_id values found across the workspace's passes (i.e. how many templates the refresh will fan out over).
SDK
const { data } = await wh.passes.refreshAllForWorkspace(workspaceId);
// data: { queued: true, templateCount: 7 }