Skip to main content
POST
/
workspaces
/
{id}
/
update
Update workspace
curl --request POST \
  --url https://api.wacht.dev/workspaces/{id}/update \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --cookie session_id= \
  --data 'name=Engineering Team' \
  --data 'description=Updated workspace description' \
  --data enforce_2fa=false \
  --data enable_ip_restriction=false \
  --data-urlencode whitelisted_ips%5B0%5D=192.168.1.0/24 \
  --data-urlencode whitelisted_ips%5B1%5D=10.0.0.1
{
  "status": 200,
  "message": "",
  "data": {
    "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"
  },
  "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

Path Parameters

id
string<uint64>
required

Workspace ID

Body

application/x-www-form-urlencoded
name
string
required

Workspace name

Example:

"Engineering Team"

description
string

Workspace description

Example:

"Updated workspace description"

enforce_2fa
boolean

Enforce MFA setup for members

Example:

false

enable_ip_restriction
boolean

Enable IP restriction

Example:

false

whitelisted_ips
string[]

Allowed IP addresses/CIDR ranges

Example:
["192.168.1.0/24", "10.0.0.1"]

Response

Workspace updated 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)