API Docs
Workspaces Model
Add Workspace
12 min
api endpoint documentation /api/workspaces/add description this endpoint allows you to create a new workspace by sending a post request the request body contains workspace details such as name, workspace type, plan id, and optional logo images endpoint headers accept application/json specifies that the request expects a json response authorization bearer \<jwt token> a json web token (jwt) that authenticates the request replace \<jwt token> with a valid token content type multipart/form data; boundary=\<boundary> specifies that the request body is in multipart/form data format, necessary for file uploads request body the request body should be in multipart/form data format, containing the following fields name string the name of the workspace workspace type string the type of workspace (e g , "iframe embed", "jwt full embed") plan id string (optional) the id of the plan to associate with the workspace square logo file (optional) a square logo image file for the workspace must be less than 10mb image logo file (optional) a logo image file for the workspace must be less than 10mb integrations string (optional) a json string containing integration configurations for the workspace example request body note for multipart/form data requests with file uploads, the actual request body will be formatted differently, with binary file content included method post sends a request to create a new workspace with the specified details example request (node js) response the api will return a json response indicating the success or failure of the operation success response (200) error response (400) or authentication this api requires a valid jwt token for authentication and admin privileges ensure that the token is included in the authorization header as bearer \<jwt token> usage notes this endpoint requires admin privileges to use the system automatically generates a unique slug from the workspace name if no plan id is provided, the system assigns a free (no charge) plan logo files must be less than 10mb in size when creating a jwt full embed workspace type, the layout type is automatically set to no navigation for other workspace types, the layout type defaults to left navigation the system automatically creates subscription and transaction records based on the selected plan if integrations are provided, the system will create workspace integration credentials for each integration the system logs workspace creation in the activity log