Skip to content

Types

Every method in the API is fully typed. This page catalogues the exported types so you can find the shape a method takes or returns. The authoritative source is src/types.ts and the per-module files (file, http, metrics). Import them from the package:

ts
import type { Activity, Workflow, User, Signal, HailerError } from '@hailer/app-sdk';

★ marks the most commonly used entity/payload types.

Core entities

TypeShape
UserA Hailer user. Only _id, firstname, lastname are populated on returned users.
WorkspaceA workspace: _id, name.
TeamA team: { _id, name }.
TeamsByWorkspaceMap of workspaceId → Team[].
TeamAccountAn { account, team } pair.
ActivityA full activity: process, phase, fields, location, files, followers, etc.
WorkflowA workflow (process) definition: fields, phases, ordering, templates.
WorkflowFieldOne field definition on a workflow.
WorkflowFieldTypeUnion of field type strings.
WorkflowPhaseOne phase in a workflow.
DocumentTemplateA print/document template descriptor.
ConfigApp config: { [fieldName]: string }.
SettingsUser UI settings: { theme: 'light' | 'dark'; preferredLanguages: string[] }.
SignalA pushed signal: { name, data }.
ApiInfoReturn shape of HailerApi.info().

Activity field values

TypeShape
ActivityFieldValueUnion of allowed field value shapes.
ActivityFieldUpdateValueActivityFieldValue | null (null clears the field).
ActivityFieldRange{ start, end }.
ActivityFieldLinkLinked activity: { _id, name }.
ActivityFieldCountry{ code } (ISO cca2).
ActivityFieldError{ error? }.
ActivityLocationLocation geometry: { data[], label?, type }.
IdSetUpdateAdd/remove/replace map: '*'?: null, [id]: true | null.

Activity operations

TypeShape
ActivityListOptionsList sort/paging/include flags.
ActivityCreateOptionsCreate-time extras (team, files, followers, location, …).
ActivityUpdateOptionsUpdate-time extras.
ActivityKanbanListOptionsKanban filter/search/paging.
PrintRequestAn activity print request.
PrintResponseA generated PDF result.
KanbanListResponsePhases→activities map with meta.
KanbanLoadResponseA single activity in kanban form.

Insights

TypeShape
InsightDocAn insight document: presets, sources, publicKey.
InsightPublicOmit<InsightDoc, '_id'>.
InsightDataRPC insight result: { headers, rows, time }.
InsightWorkflowSourceAn insight data-source definition.
InsightResponsePublic insight result: { insight, data }.
InsightResponseDataPublic insight data: { headers, rows, time }.
InsightResponseAsObjectItem / InsightResponseAsObjectsRows mapped to objects.

Forms

TypeShape
FormsDataPayload for a form submission.
FormsResponseA public form's definition.
FormCreateResponseResult of a form submission.

Permissions

TypeShape
PermissionMapTop-level per-user permission map (workflow + workspace), keyed by workspace.
PermissionType'admin' | 'own' | 'ownteam' | 'any' | 'edit'.
PermissionPathA permission grant path.
MemberA member with info + permissions.
WorkflowPermission / WorkflowPhasePermissionPermission-level unions.
WorkflowPermissionMapPer-workflow permission structure.
WorkspaceRolesPermissionRole booleans (isAdmin, isOwner, …).

Products & marketplace

TypeShape
ProductA marketplace product (extends ProductType).
ProductType{ type?: 'app' | 'template' | 'integration' | 'expert' | 'ai-agent' }.
ProductVersionA product with its versions.
VersionOne version: { version, description, packageHash, created }.
ProductListResponse{ products, totalCount }.
ProductSearchFilterSearch filter (extends ProductType).
ProductSearchOptionSearch paging/sort.
IdsMap{ [templateId]: string } install-id mapping.

Payments & pricing

TypeShape
PricingDataPricing configuration for a product.
PricingPlanOne pricing plan.
PaymentProvider / PricingProvidersProvider configuration.
CreatePricingRequest / UpdatePricingRequestPricing write requests.
CreatePurchaseRequest / CreatePurchaseResponsePurchase flow.
PurchaseA purchase/subscription record.
StripeTaxCalculationRequest / StripeTaxCalculationResponseStripe tax calculation.

Files (from modules/file)

TypeShape
FileResponse{ filename, data (base64), mimeType, tags: string[] }.
UploadOptions{ isPublic?: boolean }.

HTTP (from modules/http)

TypeShape
HTTPFetchOptions{ method?, headers?, body? }.
HTTPUploadEntry{ name, value, filename? }.
HTTPFetchResponse{ status, statusText, headers, body }.
HTTPWebSocketProxied WebSocket handle (send, close, on*, readyState, connectionId).

Metrics (from modules/metrics)

TypeShape
MetricDefinitionA metric's descriptor.
MetricDataA metric's data.
MetricOptionsQuery options (time range, aggregation, groupBy, topk, label filters).
WorkspaceMetricsListOptions / WorkspaceMetricsListResultAdmin workspace lookup.
UserMetricsListOptions / UserMetricsListResultAdmin user lookup.

Ball tracking

TypeShape
BallHolderEntry{ activityId, discussionId, activityName, ballHolder }.
BallHolder{ userId, assignedAt }.

Errors

TypeShape
HailerErrorThe error class thrown by every API method.
ApiErrorRaw error: { code, msg, debug }.

Admin

The admin request/response types back hailer.admin (internal). They include AdminWorkspace, AdminWorkspaceListRequest / AdminWorkspaceListResponse, AdminWorkspaceOverrides, AdminWorkspaceMarketplaceSettings, AdminWorkspaceUsersListRequest / AdminWorkspaceUsersListResponse, AdminUpdateUserRequest / AdminUpdateUserResponse, AdminUpdateTokenBalanceRequest, AdminTokenTransaction*, AdminInvoice*, AdminRevenue*, AdminDashboard*, AdminReferral*, AdminCreateStripeSessionRequest / Response, and AdminCreateInvoiceIntegrationRequest / Response. See src/types.ts.

Hailer Developer Documentation