Skip to main content
POST
/
workspaces
Create workspace
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."
    }
  ]
}

Authorizations

session_id
string
cookie
required

Session-based authentication using cookies

Body

multipart/form-data
name
string
required

Workspace name

Example:

"Engineering"

organization_id
string<uint64>
required

Parent organization ID

Example:

"123456789012345678"

description
string

Workspace description

Example:

"Engineering team workspace"

image
file

Workspace profile image

Response

Workspace created successfully

status
integer

HTTP status code

Example:

200

message
string

Response message (empty on success)

Example:

""

data
object
session
object

Minimal session info included in every response

errors
object[] | null

Error details (null on success)