Skip to main content

Create Client Portal Account (v1)

Method & Path

POST /api/v1/workspace/:workspaceId/nutrition/accounts

Description

Creates a portal login account for a nutrition client. The client will be able to login to the client portal using the provided username and password.

Authentication

Required: Workspace token with nutrition management permission.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <token>
Content-TypeYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID

Request Body

{
"clientId": "507f1f77bcf86cd799439011",
"username": "ahmed.mohamed",
"password": "temp123456",
"mustChangePassword": true
}

Body Fields

FieldTypeRequiredDescription
clientIdstringYesThe nutrition client ID
usernamestringYesLogin username (lowercase, alphanumeric, dots, underscores, hyphens)
passwordstringYesInitial password (min 6 characters)
mustChangePasswordbooleanNoForce password change on first login (default: true)

Response 201 Created

{
"account": {
"id": "507f1f77bcf86cd799439016",
"workspaceId": "507f1f77bcf86cd799439012",
"clientId": "507f1f77bcf86cd799439011",
"username": "ahmed.mohamed",
"status": "active",
"mustChangePassword": true,
"lastLoginAt": null,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
}

Portal Login URL

After creating the account, provide the client with:

https://nutrition-portal.placio.app/{specialistSlug}/login

Where {specialistSlug} is configured in the nutrition settings.

Common Errors

  • 400 Bad Request: Invalid input data
  • 401 Unauthorized: Missing or invalid token
  • 404 Not Found: Workspace or client not found
  • 409 Conflict: Username already exists in workspace, or client already has an account