Frontend API
Create a new workspace within an organization
cURL
curl --request POST \ --url https://api.wacht.dev/workspaces \ --header 'Content-Type: multipart/form-data' \ --cookie session_id= \ --form name=Engineering \ --form organization_id=123456789012345678 \ --form 'description=Engineering team workspace' \ --form image='@example-file'
{ "status": 200, "message": "", "data": { "workspace": { "id": "123456789012345678", "organization_id": "999999999999999999", "name": "Engineering", "description": "Engineering team workspace", "image_url": "https://cdn.wacht.dev/workspaces/123/logo.png", "whitelisted_ips": [ "192.168.1.0/24" ], "enable_ip_restriction": false, "enforce_mfa": false, "member_count": 42, "public_metadata": { "department": "Engineering" }, "private_metadata": {}, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" }, "membership": { "id": "333333333333333333", "workspace_id": "123456789012345678", "organization_membership_id": "777777777777777777", "user_id": "555555555555555555", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" } }, "session": { "id": "123456789012345678", "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z" }, "errors": [ { "code": "INVALID_CREDENTIALS", "message": "Invalid credentials. Please try again." } ] }
Session-based authentication using cookies
Workspace name
"Engineering"
Parent organization ID
"123456789012345678"
Workspace description
"Engineering team workspace"
Workspace profile image
Workspace created successfully
HTTP status code
200
Response message (empty on success)
""
Show child attributes
Minimal session info included in every response
Error details (null on success)
Was this page helpful?