planpoint-sdk-go
Official Go SDK for the PlanPoint API.Installation
Note: Responses useJSON200orJSON201depending on the endpoint.login,getFloors, andgetLeadsreturnJSON200. All other endpoints returnJSON201.
Quick Start
API Reference
Authentication
LoginWithResponse(ctx, body)
Authenticate and receive a JWT token.
| Field | Type | Required | Description |
|---|---|---|---|
body.Username | openapi_types.Email | Yes | User email |
body.Password | *string | No | User password |
body.Impersonate | *bool | No | Impersonate another user |
*LoginResponse — { JSON200: *AuthResponse{ AccessToken, Message } }
Projects
GetMyProjectsWithResponse(ctx)
List all projects belonging to the authenticated user. Requires auth.
Returns: *GetMyProjectsResponse — { JSON201: *[]ProjectSummary }
ProjectSummary: { Id, Name, Namespace?, HostName?, Status?, Paused?, CreatedAt? }
FindProjectWithResponse(ctx, body)
Find a public project by namespace and hostname. No auth required.
| Field | Type | Required | Description |
|---|---|---|---|
body.Namespace | string | Yes | Project namespace |
body.HostName | string | Yes | Allowed hostname |
*FindProjectResponse — { JSON201: *Project }
GetProjectWithResponse(ctx, id)
Get a project by ID. Requires auth.
| Param | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Project ObjectId |
*GetProjectResponse — { JSON201: *Project }
UpdateProjectWithResponse(ctx, id, body)
Update project settings. Requires auth.
| Param | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Project ObjectId |
*UpdateProjectResponse — { JSON201: *Project }
Groups
GetGroupsWithResponse(ctx)
List all groups for the authenticated user. Requires auth.
Returns: *GetGroupsResponse — { JSON201: *GroupsListResponse{ Records, Count } }
GetGroupWithResponse(ctx, id)
Get a group by ID. Requires auth.
| Param | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Group ObjectId |
*GetGroupResponse — { JSON201: *Group }
CreateGroupWithResponse(ctx, body)
Create a new group. Requires auth.
Returns: *CreateGroupResponse — { JSON201: *Group }
UpdateGroupWithResponse(ctx, id, body)
Update a group. Requires auth.
Returns: *UpdateGroupResponse — { JSON201: *Group }
Floors
GetFloorsWithResponse(ctx, params)
List all floors for a project. Requires auth.
| Param | Type | Required | Description |
|---|---|---|---|
params.Pid | string | Yes | Project ObjectId |
*GetFloorsResponse — { JSON200: *[]FloorFull }
FloorFull: { Id, Name?, Project, Level?, Position?, Path?, Image? }
GetFloorWithResponse(ctx, id)
Get a floor by ID. Requires auth.
Returns: *GetFloorResponse — { JSON201: *FloorFull }
CreateFloorWithResponse(ctx, body)
Create a new floor. Requires auth.
Returns: *CreateFloorResponse — { JSON201: *FloorFull }
UpdateFloorWithResponse(ctx, id, body)
Update a floor. Requires auth.
Returns: *UpdateFloorResponse — { JSON201: *FloorFull }
Units
GetUnitsWithResponse(ctx, params)
List all units for a project. Requires auth.
| Param | Type | Required | Description |
|---|---|---|---|
params.Pid | string | Yes | Project ObjectId |
*GetUnitsResponse — { JSON201: *UnitsListResponse{ Records, Count } }
UnitFull: { Id, Floor, Name?, UnitNumber?, Status?, Price?, Bed?, Bath?, Sqft?, Model? }
Status values: Available | OnHold | Sold | Leased | Unavailable
GetUnitWithResponse(ctx, id)
Get a unit by ID. Requires auth.
Returns: *GetUnitResponse — { JSON201: *UnitFull }
CreateUnitWithResponse(ctx, body)
Create a new unit. Requires auth.
Returns: *CreateUnitResponse — { JSON201: *UnitFull }
UpdateUnitWithResponse(ctx, id, body)
Update a unit. Requires auth.
Returns: *UpdateUnitResponse — { JSON201: *UnitFull }
DeleteUnitWithResponse(ctx, id)
Delete a unit. Requires auth.
Returns: *DeleteUnitResponse
BatchUpdateUnitsWithResponse(ctx, body)
Update multiple units at once. Requires auth.
Returns: *BatchUpdateUnitsResponse — { JSON201: *[]UnitFull }
Leads
GetLeadsWithResponse(ctx, params)
List all leads for a project. Requires auth.
| Param | Type | Required | Description |
|---|---|---|---|
params.Pid | string | Yes | Project ObjectId |
*GetLeadsResponse — { JSON200: *[]Lead }
Lead: { Id?, Name?, Email?, Phone?, Message?, Unit?, CreatedAt? }