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

# Obter Sessão

> Obter informações de uma sessão específica

## Descrição

Este endpoint retorna informações detalhadas sobre uma sessão específica, incluindo seu status atual (ativo, pausado, autenticado, etc.) e configurações.

## Parâmetros de URL

<ParamField path="session" type="string" required>
  ID único da sessão a ser consultada
</ParamField>

## Resposta

<ResponseField name="session" type="string" required>
  ID da sessão
</ResponseField>

<ResponseField name="status" type="string" required>
  Status atual da sessão: "active", "stopped", "disconnected", "authenticated"
</ResponseField>

<ResponseField name="authenticated" type="boolean" required>
  Indica se a sessão está autenticada no WhatsApp
</ResponseField>

<ResponseField name="config" type="object" optional>
  Configurações da sessão (se disponíveis)
</ResponseField>

<ResponseExample>
  ```json Resposta de Sucesso theme={null}
  {
    "session": "my-session",
    "status": "authenticated",
    "authenticated": true,
    "config": {
      "store": {
        "dialect": "sqlite3",
        "address": "/app/data/whatsmeow.db"
      },
      "log": {
        "level": "INFO"
      }
    }
  }
  ```
</ResponseExample>

## Códigos de Status

* `200` - Informações obtidas com sucesso
* `400` - Parâmetros inválidos
* `404` - Sessão não encontrada

## Exemplo de Uso

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET https://api.wappfy.com.br/api/sessions/my-session
  ```

  ```javascript JavaScript theme={null}
  const session = 'my-session';
  const response = await fetch(`https://api.wappfy.com.br/api/sessions/${session}`);
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  session = 'my-session'
  response = requests.get(f'https://api.wappfy.com.br/api/sessions/{session}')
  data = response.json()
  print(data)
  ```
</CodeGroup>


## OpenAPI

````yaml viewer.json get /api/sessions/{session}
openapi: 3.1.0
info:
  title: Wappfy - WhatsApp HTTP API
  version: '2.0'
  contact: {}
servers:
  - url: https://{host}
    description: Servidor Customizável
    variables:
      host:
        default: api.wappfy.com.br
        description: 'URL do servidor (ex: api.wappfy.com.br ou seu-servidor.com)'
security:
  - api_key: []
tags:
  - name: 🖥️ Sessions
    description: >-
      Controlar sessões do WhatsApp (contas) (Control WhatsApp sessions
      (accounts))
  - name: 🔑 Auth
    description: Autenticação
  - name: 🆔 Profile
    description: Informações do seu perfil
  - name: 🖼️ Screenshot
    description: Obter captura de tela do WhatsApp e mostrar código QR
  - name: 📤 Chatting
    description: Métodos de conversação
  - name: 📢 Channels
    description: Métodos de canais (newsletters) (Channels (newsletters) methods)
  - name: 🟢 Status
    description: Métodos de status (aka stories) (Status (aka stories) methods)
  - name: 💬 Chats
    description: Métodos de conversas
  - name: 👤 Contacts
    description: >-
      Métodos de contatos. Use número de telefone (sem +) ou número de telefone
      e `@c.us` no final como `contactId`. Ex: `12312312310` OU
      `12312312310@c.us` (Contacts methods.<br>
                      Use phone number (without +) or phone number and `@c.us` at the end as `contactId`.<br>
                      'E.g: `12312312310` OR `12312312310@c.us`<br>)
  - name: 👥 Groups
    description: Métodos de grupos (Groups methods).<br>
  - name: ✅ Presence
    description: Informações de presença
  - name: 📅 Events
    description: Mensagem de Evento
  - name: 🏷️ Labels
    description: Etiquetas - disponível apenas para contas WhatsApp Business
  - name: 🔍 Observability
    description: Outros métodos
  - name: 🗄️ Storage
    description: Métodos de armazenamento
externalDocs:
  description: Wappfy - WhatsApp HTTP API
  url: https://wappfy.com.br/
paths:
  /api/sessions/{session}:
    get:
      tags:
        - 🖥️ Sessions
      summary: Obter informações da sessão
      description: O parâmetro {session} deve ser o instanceName da sessão.
      operationId: SessionsController_get
      parameters:
        - name: session
          required: true
          in: path
          description: O nome da sessão (instanceName) que você deseja consultar
          example: my-session
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionInfo'
      security:
        - api_key: []
components:
  schemas:
    SessionInfo:
      type: object
      properties:
        name:
          type: string
          example: default
          description: Nome da instância da sessão. Use 'session' como valor padrão
        me:
          $ref: '#/components/schemas/MeInfo'
        assignedWorker:
          type: string
        status:
          enum:
            - STOPPED
            - STARTING
            - SCAN_QR_CODE
            - WORKING
            - FAILED
          type: string
        config:
          $ref: '#/components/schemas/SessionConfig'
      required:
        - name
        - status
    MeInfo:
      type: object
      properties:
        id:
          type: string
          example: 5511999999999@c.us
        pushName:
          type: string
      required:
        - id
        - pushName
    SessionConfig:
      type: object
      properties:
        metadata:
          example:
            user.id: '123'
            user.email: email@example.com
          description: Metadata for the session. You'll get 'metadata' in all webhooks.
          allOf:
            - $ref: '#/components/schemas/Map'
        proxy:
          example: null
          allOf:
            - $ref: '#/components/schemas/ProxyConfig'
        debug:
          type: boolean
          default: false
        noweb:
          example:
            store:
              enabled: true
              fullSync: false
          allOf:
            - $ref: '#/components/schemas/NowebConfig'
        webhooks:
          type: array
          items:
            $ref: '#/components/schemas/WebhookConfig'
    Map:
      type: object
      properties: {}
    ProxyConfig:
      type: object
      properties:
        server:
          type: string
          example: localhost:3128
        username:
          type: string
          example: null
        password:
          type: string
          example: null
      required:
        - server
    NowebConfig:
      type: object
      properties:
        markOnline:
          type: boolean
          default: true
          description: Mark the session as online when it connects to the server.
        store:
          $ref: '#/components/schemas/NowebStoreConfig'
      required:
        - markOnline
    WebhookConfig:
      type: object
      properties:
        url:
          type: string
          example: https://webhook.site/11111111-1111-1111-1111-11111111
          description: >-
            You can use https://docs.webhook.site/ to test webhooks and see the
            payload
        events:
          example:
            - message
            - session.status
          type: array
          items:
            type: object
        hmac:
          example: null
          allOf:
            - $ref: '#/components/schemas/HmacConfiguration'
        retries:
          example: null
          allOf:
            - $ref: '#/components/schemas/RetriesConfiguration'
        customHeaders:
          example: null
          type: array
          items:
            $ref: '#/components/schemas/CustomHeader'
      required:
        - url
        - events
    NowebStoreConfig:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
          description: Enable or disable the store for contacts, chats, and messages.
          example: true
        fullSync:
          type: boolean
          default: false
          description: >-
            Enable full sync on session initialization (when scanning QR code).

            Full sync will download all contacts, chats, and messages from the
            phone.

            If disabled, only messages early than 90 days will be downloaded and
            some contacts may be missing.
      required:
        - enabled
        - fullSync
    HmacConfiguration:
      type: object
      properties:
        key:
          type: string
          example: your-secret-key
    RetriesConfiguration:
      type: object
      properties:
        delaySeconds:
          type: number
          example: 2
        attempts:
          type: number
          example: 15
        policy:
          enum:
            - linear
            - exponential
            - constant
          type: string
          example: linear
    CustomHeader:
      type: object
      properties:
        name:
          type: string
          example: X-My-Custom-Header
        value:
          type: string
          example: Value
      required:
        - name
        - value
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apikey
      description: Sua chave de API do Wappfy (obtenha em dash.wappfy.com.br)

````