Workspaces

Admins in Zendesk Support can set up contextual workspaces to present ticket tools and features based on specific workflows. For more information, see Setting up contextual workspaces (Enterprise).

List Workspaces

GET /api/v2/workspaces.json

Allowed For
  • Admin
Using curl
curl https://{subdomain}.zendesk.com/api/v2/workspaces.json
curl https://{subdomain}.zendesk.com/api/v2/workspaces.json?per_page=2
Example Response
Status: 200 OK

  {
     "workspaces": [
  {
    "url": "https://{subdomain}.zendesk.com/api/v2/workspaces.json",
    "id": 3133,
    "title": "Test Workspace 1",
    "description": "Test rules",
    "macros": [
      360005374974,
      ...,
    ],
    "macro_ids": [
      360005374974,
      ...,
    ],
    "apps": [
      {
        "id": 360000080413,
        "expand": false,
        "position": 1
      },
      ...
    ],
    "ticket_form_id": 360000014173,
    "position": 1,
    "activated": true,
    "prefer_workspace_app_order": true,
    "selected_macros": [
      {
        "url": "https://{subdomain}.zendesk.com/api/v2/macros/360005374974.json",
        "id": 360005374974,
        "title": "Close and redirect to topics",
        "active": true,
        "updated_at": "2018-11-08T22:27:00Z",
        "created_at": "2018-02-08T23:45:30Z",
        "position": 9999,
        "description": null,
        "actions": [
          {
            "field": "status",
            "value": "solved"
          },
          ...
        ],
        "restriction": {
          "type": "Group",
          "id": 360002226093,
          "ids": [
            360002226093
         ]
        },
        "usage_7d": 0
      },
      ...
    ],
    "updated_at": "2018-12-17T22:37:40Z",
    "created_at": "2018-11-13T19:08:13Z",
    "conditions": {
      "all": [
        {
          "field": "ticket_form_id",
          "operator": "is",
          "value": "360000014173"
        },
      ],
      "any": []
    }
  },
....
],
  "next_page": null,
  "previous_page": null,
  "count": 1
}

Show Workspace

GET /api/v2/workspaces/{id}.json

Allowed For
  • Admins, Agents, and End Users
Using curl
curl https://{subdomain}.zendesk.com/api/v2/workspaces/{id}.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "workspace": {
    "url": "https://{subdomain}.zendesk.com/api/v2/workspaces.json",
    "id": 3133,
    "title": "Test Workspace 1",
    "description": "Test rules",
    "macro_ids": [
      360005374974
    ],
    "apps": [],
    "ticket_form_id": 360000014173,
    "position": 1,
    "activated": true,
    "prefer_workspace_app_order": true,
    "selected_macros": [
      {
        "url": "https://{subdomain}.zendesk.com/api/v2/macros/360005374974.json",
        "id": 360005374974,
        "title": "Close and redirect to topics",
        "active": true,
        "updated_at": "2018-11-08T22:27:00Z",
        "created_at": "2018-02-08T23:45:30Z",
        "position": 9999,
        "description": null,
        "actions": [
          {
            "field": "status",
            "value": "solved"
          },
          ...
        ],
        "restriction": {
          "type": "Group",
          "id": 360002226093,
          "ids": [
            360002226093
         ]
        },
        "usage_7d": 0
      }
    ],
    "conditions": {
      "all": [
        {
          "field": "ticket_form_id",
          "operator": "is",
          "value": "360000014173"
        }
      ],
      "any": []
    },
    "updated_at": "2018-12-17T22:37:40Z",
    "created_at": "2018-11-13T19:08:13Z"
  }
}

Create Workspace

POST /api/v2/workspaces.json

Allowed For
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/workspaces.json \
  -H "Content-Type: application/json" -X POST \
  -d '
{
  "workspace": {
    "title": "Test Workspace 1",
    "description": "Test rules",
    "ticket_form_id": 360000014173,
    "macros": [360005374974],
    "conditions": {
      "all": [
        {
          "field": "ticket_form_id",
          "operator": "is",
          "value": "360000014173"
        },
      ],
      "any": []
    }
  }
}' \
  -v -u {email_address}:{password}
Example Response
Status: 201 Created
Location: https://{subdomain}.zendesk.com/api/v2/workspaces/{id}.json

{
  "workspace": {
    "url": "https://{subdomain}.zendesk.com/api/v2/workspaces.json",
    "id": 3133,
    "title": "Test Workspace 1",
    "description": "Test rules",
    "macro_ids": [
      360005374974
    ],
    "apps": [],
    "ticket_form_id": 360000014173,
    "position": 1,
    "activated": true,
    "prefer_workspace_app_order": true,
    "selected_macros": [
      {
        "url": "https://{subdomain}.zendesk.com/api/v2/macros/360005374974.json",
        "id": 360005374974,
        "title": "Close and redirect to topics",
        "active": true,
        "updated_at": "2018-11-08T22:27:00Z",
        "created_at": "2018-02-08T23:45:30Z",
        "position": 9999,
        "description": null,
        "actions": [
          {
            "field": "status",
            "value": "solved"
          },
          ...
        ],
        "restriction": {
          "type": "Group",
          "id": 360002226093,
          "ids": [
            360002226093
         ]
        },
        "usage_7d": 0
      }
    ],
    "conditions": {
      "all": [
        {
          "field": "ticket_form_id",
          "operator": "is",
          "value": "360000014173"
        }
      ],
      "any": []
    },
    "updated_at": "2018-12-17T22:37:40Z",
    "created_at": "2018-11-13T19:08:13Z"
  }
}

Update Workspace

PUT /api/v2/workspaces/{id}.json

Allowed For
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/workspaces/{id}.json \
  -H "Content-Type: application/json" -X PUT \
  -d '{"workspace": {
          "title": "Test Workspace 1",
          "description": "Test rules",
          "ticket_form_id": 360000014173,
          "macro_ids": [360005374974],
          "conditions": {
            "all": [
              {
                "field": "status",
                "operator": "is",
                "value": "pending"
              },
            ],
            "any": []
          }
      }}' \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK
Location: https://{subdomain}.zendesk.com/api/v2/workspaces/47.json

{
  "workspace": {
    "id":                    47,
    "url":                   "https://company.zendesk.com/api/v2/workspaces/47.json",
    "title":                 "Test Workspace 1",
    "description":           "Test rules",
    "ticket_form_id":        "360000014173",
    "macro_ids":             [360005374974],
    "position":              4,
    "activated":             true,
    "conditions": {
      "all": [
        {
          "field": "status",
          "operator": "is",
          "value": "pending"
        },
      ],
      "any": []
    }
    "created_at":            "2018-02-08T23:45:30Z",
    "updated_at":            "2018-11-08T22:27:00Z"
  }
}

Delete Workspace

DELETE /api/v2/workspaces/{id}.json

Allowed For
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/workspaces/{id}.json \
  -v -u {email_address}:{password} -X DELETE
Example Response
Status: 204 No Content

Bulk Delete Workspaces

DELETE /api/v2/workspaces/destroy_many.json

Deletes the workspaces corresponding to the provided comma-separated list of IDs.

Allowed For
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/workspaces/destroy_many.json?ids=1,2,3 \
  -v -u {email}:{password} -X DELETE
Example Response
Status: 200 OK

Reorder Workspaces

PUT /api/v2/workspaces/reorder.json

Allowed For
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/workspaces/reorder.json \
  -H "Content-Type: application/json" -X PUT \
  -d '{"ids": [12, 32, 48, 60]}' \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK