Projects
Projects are workspace-scoped containers that group pass templates, passes, and distributions. Every project row carries a workspace_id foreign key, and access is enforced server-side: list/create endpoints are scoped by the workspace in the path, while single-project endpoints derive the workspace from the project row itself so a member of workspace A cannot read or mutate workspace B's projects.
Auth (all endpoints): Bearer token — caller must be a member of the owning workspace (createWorkspaceGuard).
List Projects
GET /wallethero-api/workspace/:workspaceId/projects
Returns every project in the workspace, newest first.
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/projects" \
-H "Authorization: Bearer YOUR_TOKEN"Response (200)
{
"data": [
{
"id": "8f1c0e2a-1234-4a5b-9c6d-7e8f90123456",
"name": "Summer Loyalty",
"workspace_id": "WORKSPACE_ID",
"date_created": "2026-06-01T10:00:00.000Z",
"user_created": "USER_ID"
}
]
}SDK
const projects = await wh.projects.getByWorkspace(workspaceId);
// or, via the filter-shaped list helper:
const projects = await wh.projects.list({ filter: { workspace_id: { _eq: workspaceId } } });Create Project
POST /wallethero-api/workspace/:workspaceId/projects
Creates a project in the workspace. The server forces workspace_id to the path value and stamps user_created from the authenticated user.
Auth: Bearer token — workspace member.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
workspaceId | string (UUID) | Workspace identifier |
Request Body
Any project field may be supplied; the request body is spread onto the new row. workspace_id and user_created are set server-side and cannot be overridden via the body. In practice a project needs at least a name.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Project display name |
Example Request
curl -X POST "https://api.wallethero.app/wallethero-api/workspace/WORKSPACE_ID/projects" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "Summer Loyalty" }'Response (201)
{
"data": {
"id": "8f1c0e2a-1234-4a5b-9c6d-7e8f90123456",
"name": "Summer Loyalty",
"workspace_id": "WORKSPACE_ID",
"user_created": "USER_ID",
"date_created": "2026-06-16T12:00:00.000Z"
}
}SDK
const project = await wh.projects.create({ workspace_id: workspaceId, name: "Summer Loyalty" });Get Project
GET /wallethero-api/projects/:id
Fetches a single project by id. The workspace is derived from the project row, so the caller must be a member of the project's workspace.
Auth: Bearer token — member of the project's workspace. Returns Project not found if the id does not exist.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | Project identifier |
Example Request
curl "https://api.wallethero.app/wallethero-api/projects/PROJECT_ID" \
-H "Authorization: Bearer YOUR_TOKEN"Response (200)
{
"data": {
"id": "PROJECT_ID",
"name": "Summer Loyalty",
"workspace_id": "WORKSPACE_ID"
}
}SDK
const project = await wh.projects.get(projectId);Update Project
PATCH /wallethero-api/projects/:id
Updates a project. workspace_id is stripped from the body to prevent moving the row to another tenant; user_updated is stamped from the authenticated user.
Auth: Bearer token — member of the project's workspace.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | Project identifier |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | New project name |
workspace_id | string | — | Ignored — cannot reassign the project to another workspace |
Example Request
curl -X PATCH "https://api.wallethero.app/wallethero-api/projects/PROJECT_ID" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "Autumn Loyalty" }'Response (200)
{
"data": {
"id": "PROJECT_ID",
"name": "Autumn Loyalty",
"workspace_id": "WORKSPACE_ID",
"user_updated": "USER_ID"
}
}SDK
const project = await wh.projects.update(projectId, { name: "Autumn Loyalty" });Delete Project
DELETE /wallethero-api/projects/:id
Deletes the project.
Auth: Bearer token — member of the project's workspace.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | Project identifier |
Example Request
curl -X DELETE "https://api.wallethero.app/wallethero-api/projects/PROJECT_ID" \
-H "Authorization: Bearer YOUR_TOKEN"Response (200)
{ "message": "Project deleted successfully" }SDK
await wh.projects.delete(projectId);Project Stats
GET /wallethero-api/projects/:id/stats
Returns per-project counts: number of pass templates and number of passes attached to the project.
Auth: Bearer token — member of the project's workspace.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | Project identifier |
Example Request
curl "https://api.wallethero.app/wallethero-api/projects/PROJECT_ID/stats" \
-H "Authorization: Bearer YOUR_TOKEN"Response (200)
{ "data": { "templateCount": 3, "passCount": 142 } }SDK
const { templateCount, passCount } = await wh.projects.getStats(projectId);List Project Templates
GET /wallethero-api/projects/:id/templates
Returns every pass template belonging to the project (project_id match), newest first.
Auth: Bearer token — member of the project's workspace.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | Project identifier |
Example Request
curl "https://api.wallethero.app/wallethero-api/projects/PROJECT_ID/templates" \
-H "Authorization: Bearer YOUR_TOKEN"Response (200)
{
"data": [
{
"id": "TEMPLATE_ID",
"project_id": "PROJECT_ID",
"name": "Gold Card",
"date_created": "2026-06-01T10:00:00.000Z"
}
]
}SDK
const templates = await wh.projects.getTemplates(projectId);List Project Passes
GET /wallethero-api/projects/:id/passes
Returns every pass belonging to the project (project_id match), newest first.
Auth: Bearer token — member of the project's workspace.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | Project identifier |
Example Request
curl "https://api.wallethero.app/wallethero-api/projects/PROJECT_ID/passes" \
-H "Authorization: Bearer YOUR_TOKEN"Response (200)
{
"data": [
{
"id": "PASS_ID",
"project_id": "PROJECT_ID",
"pass_template_id": "TEMPLATE_ID",
"workspace_id": "WORKSPACE_ID",
"date_created": "2026-06-10T08:30:00.000Z"
}
]
}SDK
const passes = await wh.projects.getPasses(projectId);List Project Distributions
GET /wallethero-api/projects/:id/distributions
Returns every distribution belonging to the project (project_id match), newest first.
Auth: Bearer token — member of the project's workspace.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | Project identifier |
Example Request
curl "https://api.wallethero.app/wallethero-api/projects/PROJECT_ID/distributions" \
-H "Authorization: Bearer YOUR_TOKEN"Response (200)
{
"data": [
{
"id": "DISTRIBUTION_ID",
"project_id": "PROJECT_ID",
"date_created": "2026-06-05T09:00:00.000Z"
}
]
}SDK
No SDK method — call the REST endpoint directly.