# List workspaces

Retrieves a list of workspaces that the user has access to. It returns metadata for the workspaces only and doesn't include nested sub-structures.

> See also: Pagination - SDK examples demonstrates listing workspaces with token-based pagination.

Endpoint: GET /workspaces
Version: 2.0.0
Security: APIToken, OAuth2

## Header parameters:

  - `Authorization` (string)
    API Access Token used to authenticate requests to Smartsheet APIs.

  - `smartsheet-integration-source` (string)
    Uses the following metadata to distinguish between human-initiated API requests and third-party service-initiated calls by AI Connectors or ITSM:

- Integration source type
- Organization name
- Integration source name 

Format:


TYPE,OrgName,SourceName


Examples: 

AI,SampleOrg,My-AI-Connector-v2

SCRIPT,SampleOrg2,Accounting-updater-script

APPLICATION,SampleOrg3,SheetUpdater
    Example: "AI,SampleOrg,My-AI-Connector-v2"

## Query parameters:

  - `accessApiLevel` (number)
    Allows COMMENTER access for inputs and return values. For backwards-compatibility, VIEWER is the default. For example, to see whether a user has COMMENTER access for a sheet, use accessApiLevel=1.

  - `maxItems` (integer)
    Request query parameter used in ListWorkspaces endpoints that support token based pagination.

The maximum amount of items to return in the response. The default and minimum are 100.
    Example: 100

  - `lastKey` (string)
    The lastKey token returned from the previous page of results. If not specified,
the first page of results is returned.
    Example: "abcDefGhIjKlMnOpQrStUvWxYz"

## Response 200 fields (application/json):

  - `lastKey` (string)
    A token that is used to retrieve the next page of results when passed as the
lastKey query parameter. This value will be absent when there are no 
further pages.
    Example: "abcDefGhIjKlMnOpQrStUvWxYz"

  - `data` (array)

  - `data.id` (number)
    Workspace ID.

  - `data.name` (string)
    Workspace name.

  - `data.accessLevel` (string)
    Enum: "ADMIN", "COMMENTER", "EDITOR", "EDITOR_SHARE", "OWNER", "VIEWER"

  - `data.permalink` (string)
    URL that represents a direct link to the workspace in Smartsheet.

## Response default fields (application/json):

  - `refId` (string)
    The ID of the specific error occurrence. Please include this information when contacting Smartsheet support.

  - `errorCode` (number)
    Custom error code from Smartsheet. See the complete [Error Code List](/api/smartsheet/error-codes).

  - `message` (string)
    Descriptive error message.


