> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tess.im/llms.txt
> Use this file to discover all available pages before exploring further.

# Listar workspaces

> Retorna os workspaces em que seu token de API pode ser usado, com o seu papel em cada um. Não recebe o header x-workspace-id.

Chame este endpoint primeiro quando sua integração trabalha com vários workspaces. Ele devolve o id a enviar no header `x-workspace-id` dos outros endpoints, ou na entrada `workspace_id` das ferramentas do [Tess MCP](https://docs.tess.im/pt/api-mcp.md#choosing-the-workspace).

Um workspace só aparece quando seu token é aceito nele: você é membro ativo, o seu papel ali inclui acesso à API, e as regras de login único (SSO) do workspace não bloqueiam você. Os outros endpoints respondem **403** para um workspace que não está nesta lista.


## OpenAPI

````yaml api-reference/tess-public-api.openapi.json GET /workspaces
openapi: 3.0.0
info:
  title: Tess API
  version: '0.1'
servers:
  - url: https://api.tess.im
security: []
paths:
  /workspaces:
    get:
      tags:
        - Workspaces
      summary: List workspaces
      description: >-
        Returns the workspaces this token can be used in, with the role of the
        token owner in each one. It takes no x-workspace-id header: call it
        first to get the id to send in the x-workspace-id header of the other
        endpoints.
      operationId: listWorkspaces
      responses:
        '200':
          description: The workspaces of the token owner
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        name:
                          type: string
                        role:
                          type: string
                          nullable: true
                          description: Role of the token owner in this workspace
              example:
                data:
                  - id: 4645
                    name: Marketing
                    role: owner
                  - id: 4821
                    name: HR team
                    role: manager
                  - id: 4644
                    name: Sales
                    role: user
        '401':
          description: Unauthenticated
      security:
        - token: []
components:
  securitySchemes:
    token:
      type: http
      bearerFormat: Bearer
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.