@planpoint/sdk
Official TypeScript SDK for the PlanPoint API.Installation
Quick Start
API Reference
Authentication
login(options)
Authenticate and receive a JWT token.
| Param | Type | Required | Description |
|---|---|---|---|
body.username | string | Yes | User email |
body.password | string | No | User password |
body.impersonate | boolean | No | Impersonate another user |
LoginResponse — { message: string, access_token: string }
Projects
getMyProjects(options)
List all projects belonging to the authenticated user. Requires auth.
Returns: ProjectSummary[] — { _id, name, namespace?, hostName?, status?, paused?, createdAt? }
findProject(options)
Find a public project by namespace and hostname. No auth required.
| Param | Type | Required | Description |
|---|---|---|---|
body.namespace | string | Yes | Project namespace |
body.hostName | string | Yes | Allowed hostname |
Project — full project with floors, units, settings
getProject(options)
Get a project by ID. Requires auth.
| Param | Type | Required | Description |
|---|---|---|---|
path.id | string | Yes | Project ObjectId |
Project
updateProject(options)
Update project settings. Requires auth.
| Param | Type | Required | Description |
|---|---|---|---|
path.id | string | Yes | Project ObjectId |
body | Record<string, unknown> | Yes | Fields to update |
Project
Groups
getGroups(options)
List all groups for the authenticated user.
Returns: GroupsListResponse — { records: Group[], count: number }
getGroup(options)
Get a group by ID.
| Param | Type | Required | Description |
|---|---|---|---|
path.id | string | Yes | Group ObjectId |
Group — { _id, name, namespace?, hostName?, type?, projects?, isOwner?, isAdmin?, isEditor? }
createGroup(options)
Create a new group.
| Param | Type | Required | Description |
|---|---|---|---|
body.name | string | Yes | Group name |
body.namespace | string | No | Namespace |
body.hostName | string | No | Hostname |
body.type | string | No | Group type |
body.propertyType | string | No | Property type |
Group
updateGroup(options)
Update a group.
| Param | Type | Required | Description |
|---|---|---|---|
path.id | string | Yes | Group ObjectId |
body | Record<string, unknown> | Yes | Fields to update |
Group
Floors
getFloors(options)
List all floors for a project.
| Param | Type | Required | Description |
|---|---|---|---|
query.pid | string | Yes | Project ObjectId |
FloorFull[] — { _id, name?, project, level?, position?, path?, image? }
getFloor(options)
Get a floor by ID.
| Param | Type | Required | Description |
|---|---|---|---|
path.id | string | Yes | Floor ObjectId |
FloorFull
createFloor(options)
Create a new floor.
| Param | Type | Required | Description |
|---|---|---|---|
body.project._id | string | Yes | Project ObjectId |
body.name | string | Yes | Floor name |
body.position | number | No | Display order |
body.path | string | No | SVG/image path |
body.alternativePaths | string[] | No | Additional paths |
FloorFull
updateFloor(options)
Update a floor.
| Param | Type | Required | Description |
|---|---|---|---|
path.id | string | Yes | Floor ObjectId |
body | Record<string, unknown> | Yes | Fields to update |
FloorFull
Units
getUnits(options)
List all units for a project.
| Param | Type | Required | Description |
|---|---|---|---|
query.pid | string | Yes | Project ObjectId |
UnitsListResponse — { records: UnitFull[], count: number }
UnitFull: { _id, floor, name?, unitNumber?, status?, price?, bed?, bath?, sqft?, model?, orientation?, parking? }
status values: Available | OnHold | Sold | Leased | Unavailable
getUnit(options)
Get a unit by ID.
| Param | Type | Required | Description |
|---|---|---|---|
path.id | string | Yes | Unit ObjectId |
UnitFull
createUnit(options)
Create a new unit.
| Param | Type | Required | Description |
|---|---|---|---|
body.floor._id | string | Yes | Floor ObjectId |
UnitFull
updateUnit(options)
Update a unit.
| Param | Type | Required | Description |
|---|---|---|---|
path.id | string | Yes | Unit ObjectId |
body | Record<string, unknown> | Yes | Fields to update |
UnitFull
deleteUnit(options)
Delete a unit.
| Param | Type | Required | Description |
|---|---|---|---|
path.id | string | Yes | Unit ObjectId |
{ message: string }
batchUpdateUnits(options)
Update multiple units at once.
| Param | Type | Required | Description |
|---|---|---|---|
body.ids | string[] | Yes | Unit ObjectIds to update |
body.patchData | Record<string, unknown> | Yes | Fields to apply to all |
UnitFull[]
Leads
getLeads(options)
List all leads for a project.
| Param | Type | Required | Description |
|---|---|---|---|
query.pid | string | Yes | Project ObjectId |
Lead[] — { _id?, name?, email?, phone?, message?, unit?, createdAt? }