Skip to main content

Close or Reopen Workspace Services (v1)

Method & Path​

PATCH /api/v1/admin/workspaces/:workspaceId/services-closure

Description​

Closes or reopens a workspace. While closed, the client app (Workspace Owner and Staff), the storefront, and related public services refuse access and return the message entered here.

Persona access: Admin with businesses.manage. Workspace Owner, Staff, and Customer cannot call this endpoint.

Backend path: /v1/admin/workspaces/:workspaceId/services-closure

Closed surfaces:

  • Workspace Owner and Staff login, plus every authenticated client API
  • Public storefront (including orders, products, and content pages)
  • Public vCard
  • Public forms and contests
  • Public car rental
  • Nutrition client portal
  • Public lab-visit print links

Reopening clears the message and restores those surfaces.

Authentication​

Required: Admin authentication with businesses.manage permission.

Authorization: Bearer <admin_token>

Headers​

Authorization: Bearer <admin_token>
Content-Type: application/json

Path Parameters​

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID

Request Body​

{
"closed": true,
"message": "الخدمة متوقفة مؤقتاً. يرجى التواصل مع الدعم."
}
FieldTypeRequiredDescription
closedbooleanYestrue to close services, false to reopen them
messagestringRequired when closed is trueVisitor and client message, 1–500 characters. Ignored when reopening

Response 200 OK​

{
"message": "Client system, storefront, and related services closed",
"workspace": {
"id": "65f1c1a2b3c4d5e6f7a8b902",
"email": "admin@ivana.ps",
"servicesClosure": {
"closed": true,
"message": "الخدمة متوقفة مؤقتاً. يرجى التواصل مع الدعم.",
"closedAt": "2026-10-11T14:20:00.000Z"
}
}
}

Common Errors​

  • 400 Bad Request: Invalid workspace ID, or a closing message was missing or longer than 500 characters
  • 401 Unauthorized: Missing or invalid admin authentication token
  • 403 Forbidden: Insufficient permissions (missing businesses.manage)
  • 404 Not Found: Workspace not found
  • 500 Internal Server Error: Server error