Skip to content

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

PageContents
Create & retrieveCreate a workspace, list your workspaces, get a single workspace
Update & deleteUpdate name/slug, delete or clear a workspace, seed a demo user
MembersList members, add/remove members, get/change member role
InvitationsInvite, list, look up, accept, revoke, and resend invitations
Feature flagsRead per-workspace feature flags
CertificatesApple Pass Type ID certificate management (see certificates reference)

Workspace Structure

typescript
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

RolePermissions
adminFull access, can manage members, settings, invitations, and delete the workspace
memberCan 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

ParameterTypeDescription
workspaceIdstring (UUID)Workspace identifier

Example Request

bash
curl "https://api.wallethero.app/wallethero-api/workspace/WORKSPACE_ID/stats" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response (200)

json
{
  "data": {
    "passCount": 1280,
    "templateCount": 7,
    "appleRegistrationCount": 540,
    "googleRegistrationCount": 612
  }
}

SDK

typescript
const stats = await wh.workspaces.getStats("WORKSPACE_ID");
// { passCount, templateCount, appleRegistrationCount, googleRegistrationCount }

WalletHero Documentation