Workspaces
Workspaces are the top-level organizational unit in WalletHero. Each workspace owns its projects, templates, passes, clients, members, and invitations. Every workspace-scoped endpoint requires the caller to be a member of that workspace (enforced by the workspace guard middleware); mutating operations additionally require a specific role permission (manage_members, manage_workspace_settings, delete_workspace, etc.). A few endpoints are platform-admin only.
Authentication
All endpoints require Authorization: Bearer <token> and Content-Type: application/json, except GET /wallethero-api/invitation/:token, which is public (the invitation token in the path is the credential).
Sub-pages
| Page | Contents |
|---|---|
| Create & retrieve | Create a workspace, list your workspaces, get a single workspace |
| Update & delete | Update name/slug, delete or clear a workspace, seed a demo user |
| Members | List members, add/remove members, get/change member role |
| Invitations | Invite, list, look up, accept, revoke, and resend invitations |
| Feature flags | Read per-workspace feature flags |
| Certificates | Apple Pass Type ID certificate management (see certificates reference) |
Workspace Structure
interface Workspace {
id: string; // UUID
name: string;
slug: string; // URL-friendly identifier (a-z and underscores)
date_created?: string;
date_updated?: string;
user_created?: string; // UUID of the creator
}Member Roles
| Role | Permissions |
|---|---|
admin | Full access, can manage members, settings, invitations, and delete the workspace |
member | Can create/edit projects, templates, passes, campaigns, and segments; cannot manage the workspace |
Workspace Statistics
GET /wallethero-api/workspace/:workspaceId/stats
Returns per-workspace counts of passes, templates, and Apple/Google device registrations.
Auth: Bearer token — workspace member.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
workspaceId | string (UUID) | Workspace identifier |
Example Request
curl "https://api.wallethero.app/wallethero-api/workspace/WORKSPACE_ID/stats" \
-H "Authorization: Bearer YOUR_TOKEN"Response (200)
{
"data": {
"passCount": 1280,
"templateCount": 7,
"appleRegistrationCount": 540,
"googleRegistrationCount": 612
}
}SDK
const stats = await wh.workspaces.getStats("WORKSPACE_ID");
// { passCount, templateCount, appleRegistrationCount, googleRegistrationCount }