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

# Obter workspace

> Retorna o workspace da API Key. O `id` deve ser o workspaceId da chave. Requer escopo **workspace:read**. Inclui `inboundSettings` (política efetiva de recebimento por canal, sempre resolvida com defaults).



## OpenAPI

````yaml /es/guides/workspaces/api-reference/openapi-workspaces.json get /v1/workspaces/{id}
openapi: 3.0.3
info:
  title: Notifique API — Workspaces
  description: >-
    API para **criar**, **editar** e **deletar** workspaces. Use para gerenciar
    múltiplos workspaces via API (criar novo workspace para o mesmo usuário,
    atualizar nome/cor/instância padrão ou remover um workspace).


    **Autenticação:** todas as rotas exigem API Key no header `Authorization:
    Bearer sk_live_xxxxx` ou `x-api-key: sk_live_xxxxx`. Editar e deletar só
    permitem operar no workspace ao qual a API Key pertence.
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Produção
security:
  - BearerAuth: []
  - ApiKeyHeader: []
tags:
  - name: Workspaces
    description: CRUD de workspaces (criar, editar, deletar)
paths:
  /v1/workspaces/{id}:
    get:
      tags:
        - Workspaces
      summary: Obter workspace
      description: >-
        Retorna o workspace da API Key. O `id` deve ser o workspaceId da chave.
        Requer escopo **workspace:read**. Inclui `inboundSettings` (política
        efetiva de recebimento por canal, sempre resolvida com defaults).
      operationId: getV1WorkspacesById
      parameters:
        - name: id
          in: path
          required: true
          description: ID do workspace (deve ser o workspace da API Key).
          schema:
            type: string
      responses:
        '200':
          description: Workspace encontrado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceGetResponse'
              example:
                success: true
                data:
                  id: clxx...
                  name: Meu Workspace
                  slug: meu-workspace-123
                  color: '#10B981'
                  defaultInstanceId: clzz...
                  defaultEmailDomainId: null
                  inboundSettings:
                    version: 1
                    channels:
                      sms:
                        enabled: true
                      whatsapp:
                        enabled: true
                        allowPrivateChats: true
                        allowGroupChats: true
                      email:
                        enabled: true
                      telegram:
                        enabled: true
                  updatedAt: '2025-02-23T10:30:00.000Z'
        '401':
          description: API Key ausente ou inválida.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error: Bad Request
                code: VALIDATION_ERROR
                message: Campo inválido ou ausente.
        '403':
          description: Escopo workspace:read ausente.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error: Bad Request
                code: VALIDATION_ERROR
                message: Campo inválido ou ausente.
        '404':
          description: Workspace não encontrado (id não é o da API Key).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error: Bad Request
                code: VALIDATION_ERROR
                message: Campo inválido ou ausente.
components:
  schemas:
    WorkspaceGetResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            slug:
              type: string
            color:
              type: string
              nullable: true
            defaultInstanceId:
              type: string
              nullable: true
            defaultEmailDomainId:
              type: string
              nullable: true
            inboundSettings:
              $ref: '#/components/schemas/InboundSettings'
            updatedAt:
              type: string
              format: date-time
      example:
        success: true
        data:
          id: clxx...
          name: Exemplo
          slug: string
          color: string
          defaultInstanceId: clxx...
          defaultEmailDomainId: clxx...
          inboundSettings:
            version: 1
            storagePricing: {}
            channels: {}
          updatedAt: '2025-02-10T14:00:00.000Z'
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        message:
          type: string
        code:
          type: string
        details:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
      example:
        success: false
        error: string
        message: string
        code: string
        details:
          - field: string
            message: string
    InboundSettings:
      type: object
      description: >-
        Política efetiva de inbound (sempre **v2** na resposta da API;
        documentos **v1** no banco são promovidos ao ler). `channels` inclui
        `sms`, `whatsapp` (com `dm` e `group`, cada um com
        `defaultActions.persist|webhook` e `rules`), `email`, `telegram`, `rcs`.
        Opcional `storagePricing` com `credits`/`cents` (null = usar padrão da
        plataforma via env).
      properties:
        version:
          type: integer
          enum:
            - 1
            - 2
          description: Versão do documento persistido (1 legado) ou resolvida (2).
        storagePricing:
          type: object
          additionalProperties: true
        channels:
          type: object
          additionalProperties: true
          properties:
            sms:
              type: object
              additionalProperties: true
              example:
                enabled: true
              properties:
                enabled:
                  type: boolean
                  example: true
            whatsapp:
              type: object
              additionalProperties: true
              example:
                enabled: true
                allowPrivateChats: true
                allowGroupChats: true
              properties:
                enabled:
                  type: boolean
                  example: true
                allowPrivateChats:
                  type: boolean
                  example: true
                allowGroupChats:
                  type: boolean
                  example: false
            email:
              type: object
              additionalProperties: true
              example:
                enabled: true
              properties:
                enabled:
                  type: boolean
                  example: true
            telegram:
              type: object
              additionalProperties: true
              example:
                enabled: true
              properties:
                enabled:
                  type: boolean
                  example: true
      additionalProperties: true
      example:
        version: 1
        storagePricing: {}
        channels: {}
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'API Key: Authorization: Bearer sk_live_xxxxx'
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: 'API Key: x-api-key: sk_live_xxxxx'

````