# Update workspace

> Partially update a workspace.

Source: https://docs.mycrmsim.com/docs/workspaces/update-workspace

```http
PATCH https://backend.mysmsgateway.app/api/v1/ext/workspaces/{id}
```

- Category: myCRMSIM Workspaces / Workspaces
- Auth: Bearer access token
- Scope: `workspaces.write`

Send any subset of the writable fields. `remote_id` is not updatable — it ties the workspace to its source system, and changing it would break synchronization.

The inbound webhook can also be managed through this endpoint:
• Send `inbound_webhook_url` with a new URL to register or change the webhook (creates it if it does not yet exist).
• Send `inbound_webhook_headers` to update the headers — when omitted the previously stored headers are preserved.
• Send `inbound_webhook_url: ""` (or `null`) to remove the webhook entirely.

The response always includes the current `inbound_webhook` object when one is configured, mirroring **Get workspace**.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | number | yes | Workspace id. Example: `7` |
| `user_type` | body | enum | no | Must be "Custom Location" (the only workspace type the external API can manage). |
| `name` | body | string | no | Display name. Max 255. |
| `address` | body | string | no | Updates meta.address. |
| `phone_number` | body | string | no | Updates meta.phone_number. |
| `email` | body | string | no | Lowercased. Updates meta.email. |
| `url` | body | string | no | Updates meta.url. |
| `allow_contact` | body | string | no | "0" or "1". |
| `inbound_webhook_url` | body | string | no | Register, change, or clear the inbound webhook URL. Pass `""` or `null` to remove the webhook entirely. Must be http(s) when supplied. Example: `https://your-app.example.com/inbound/messages` |
| `inbound_webhook_headers` | body | array<{key,value}> | no | Replace the stored headers with this list. Sent as `[{ "key": "...", "value": "..." }]`. Omit to keep the existing headers untouched. |

## Request body

```json
{
  "name": "Acme HQ (renamed)",
  "allow_contact": "1",
  "inbound_webhook_url": "https://your-app.example.com/inbound/messages",
  "inbound_webhook_headers": [
    {
      "key": "x-webhook-secret",
      "value": "your-shared-secret"
    }
  ]
}
```

## Response fields (workspace)

| Field | Type | Description |
| --- | --- | --- |
| `id` | number | Unique workspace id. |
| `remote_id` | string | Server-generated unique identifier (20-character hex string). Not accepted in the request body — always assigned when the workspace is created. |
| `source` | string | Where the workspace came from. Workspaces created via this API have source "myCRMSIM". |
| `user_id` | number | The installer this workspace belongs to. |
| `user_type` | enum | The workspace type. Workspaces created via this API are always "Custom Location" — "Location" appears for workspaces that originated from a connected platform. |
| `name` | string, nullable | Display name. Stored inside `meta` and surfaced here for convenience. |
| `address` | string, nullable | Street address. From meta. |
| `phone_number` | string, nullable | Primary phone number. From meta. |
| `email` | string, nullable | Primary email. Lowercased. From meta. |
| `url` | string, nullable | Public website. From meta. |
| `meta` | object | Raw meta JSON. The fields above are mirrored here. |
| `allow_contact` | string | "0" or "1" — whether inbound contacts can auto-create here. Defaults to "0". |
| `company_id` | number, nullable | External platform company ID (for Location workspaces). |
| `whitelabel_setting_id` | number, nullable | Identifier of the white-label brand this workspace belongs to. |
| `custom_menu_link_id` | string, nullable | Embedded app menu link ID. |
| `subaccount_action` | number | Bitfield describing the sub-account action state. 0 = default. |
| `whatsapp_connection_id` | number, nullable | Identifier of the WhatsApp connection assigned to this workspace. |
| `whatsapp_delay` | number, nullable | Per-message send delay in seconds for the WhatsApp channel. |
| `is_token_expired` | number, nullable | 1 if the upstream OAuth token for this workspace has expired and needs re-authorization. |
| `created_at` | string (ISO 8601) | When the workspace was created. |
| `updated_at` | string (ISO 8601) | When the workspace was last modified. |
| `deleted_at` | string (ISO 8601), nullable | Set when the workspace has been soft-deleted. null for active records. |

## Response 200

Updated (with inbound webhook)

```json
{
  "success": true,
  "data": {
    "id": 7,
    "remote_id": "4f8a7e1d2c9b3a5f6e0d1",
    "source": "myCRMSIM",
    "user_id": 42,
    "user_type": "Custom Location",
    "name": "Acme HQ (renamed)",
    "address": "12 Mayfair St, London",
    "phone_number": "+442071234567",
    "email": "hq@acme.example.com",
    "url": "https://acme.example.com",
    "meta": {
      "name": "Acme HQ",
      "address": "12 Mayfair St, London",
      "phone_number": "+442071234567",
      "email": "hq@acme.example.com",
      "url": "https://acme.example.com"
    },
    "allow_contact": "1",
    "company_id": null,
    "whitelabel_setting_id": 1,
    "custom_menu_link_id": null,
    "subaccount_action": 0,
    "whatsapp_connection_id": null,
    "whatsapp_delay": null,
    "is_token_expired": 0,
    "created_at": "2026-05-21T09:14:22.000Z",
    "updated_at": "2026-05-21T09:14:22.000Z",
    "deleted_at": null,
    "inbound_webhook": {
      "url": "https://your-app.example.com/inbound/messages",
      "headers": [
        {
          "key": "x-webhook-secret",
          "value": "your-shared-secret"
        }
      ]
    }
  }
}
```

## Response 200

Updated (webhook unchanged or absent)

```json
{
  "success": true,
  "data": {
    "id": 7,
    "remote_id": "4f8a7e1d2c9b3a5f6e0d1",
    "source": "myCRMSIM",
    "user_id": 42,
    "user_type": "Custom Location",
    "name": "Acme HQ (renamed)",
    "address": "12 Mayfair St, London",
    "phone_number": "+442071234567",
    "email": "hq@acme.example.com",
    "url": "https://acme.example.com",
    "meta": {
      "name": "Acme HQ",
      "address": "12 Mayfair St, London",
      "phone_number": "+442071234567",
      "email": "hq@acme.example.com",
      "url": "https://acme.example.com"
    },
    "allow_contact": "1",
    "company_id": null,
    "whitelabel_setting_id": 1,
    "custom_menu_link_id": null,
    "subaccount_action": 0,
    "whatsapp_connection_id": null,
    "whatsapp_delay": null,
    "is_token_expired": 0,
    "created_at": "2026-05-21T09:14:22.000Z",
    "updated_at": "2026-05-21T09:14:22.000Z",
    "deleted_at": null
  }
}
```

## Response 400

No editable fields provided

```json
{
  "success": false,
  "message": "No editable fields provided."
}
```

## Response 400

inbound_webhook_url is not an http(s) URL.

```json
{
  "success": false,
  "message": "inbound_webhook_url must be an http(s) URL."
}
```

## Response 400

inbound_webhook_headers is not an array of { key, value } objects.

```json
{
  "success": false,
  "message": "inbound_webhook_headers must be an array of { key, value } objects."
}
```

## Response 400

inbound_webhook_headers entries are missing a key.

```json
{
  "success": false,
  "message": "inbound_webhook_headers entries must each include a non-empty key."
}
```

## Response 404

Workspace does not exist or is not owned by the installer

```json
{
  "success": false,
  "message": "Workspace not found"
}
```
