post__workspace
POST /workspace
Create Workspace
Create a new workspace for the authenticated user's organization. The creator will automatically be added as an admin of the workspace.
TypeScript Client Library
public createWorkspace = async (request: WorkspaceTypes.CreateWorkspaceRequest): Promise<WorkspaceTypes.CreateWorkspaceResponse> => {
return this.makeRequest<WorkspaceTypes.CreateWorkspaceResponse>('workspace', 'POST', request);
};
Code Samples
# You can also use wget
curl -X POST https://backend.flashback.tech/workspace \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d '{
"name": "Development Workspace"
}'
Body parameter
{
"name": "Development Workspace"
}
Parameters
body
body
object
true
Workspace creation data
» name
body
string
true
The name of the workspace to create
Request Body Schema
» name
string
true
none
The name of the workspace
Example responses
201 Response
{
"success": true,
"workspace": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Development Workspace",
"orgId": "987fcdeb-51a2-43d1-9f12-345678901234"
}
}
400 Response
{
"success": false,
"message": "User not found or account is not validated"
}
403 Response
{
"success": false,
"message": "Insufficient permissions to create workspaces"
}
500 Response
{
"success": false,
"message": "Failed to create workspace"
}
Responses
Response Schema
Status Code 201
» success
boolean
true
none
Operation success status
» workspace
object
true
none
Created workspace details
»» id
string
true
none
Unique workspace identifier
»» name
string
true
none
Workspace name
»» orgId
string
true
none
Organization identifier
Status Code 400
» success
boolean
true
none
Operation success status
» message
string
true
none
Error message
Status Code 403
» success
boolean
true
none
Operation success status
» message
string
true
none
Error message
Status Code 500
» success
boolean
true
none
Operation success status
» message
string
true
none
Error message
Notes
Authentication Required: User must be authenticated with a valid Bearer token
Permissions: User must have OWNER, ADMINISTRATORS, or WORKSPACES role in their organization
Account Validation: User account must be validated to create workspaces
Workspace Naming: Workspace names must be unique within the organization
Auto-Admin: The creator is automatically added as an admin of the workspace
Last updated
Was this helpful?