# Assinar live updates temporários de um canal

POST /newsletter/subscribe

Assina temporariamente os live updates internos do WhatsApp para um canal.

Observação:
- esta rota retorna apenas a duração da assinatura temporária
- isso não cria um novo evento de webhook


## Autenticação

```json
[
  {
    "token": []
  }
]
```

```json
{
  "token": {
    "name": "token",
    "type": "apiKey",
    "in": "header"
  }
}
```

## Corpo da requisição

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "required": [
          "jid"
        ],
        "properties": {
          "jid": {
            "type": "string",
            "description": "JID do canal. Aceita o formato completo `120363123456789012@newsletter` ou apenas o identificador numérico.",
            "example": "120363123456789012@newsletter"
          }
        }
      }
    }
  }
}
```

## Respostas

```json
{
  "200": {
    "description": "Assinatura criada com sucesso",
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "response"
          ],
          "properties": {
            "response": {
              "type": "string",
              "description": "Duração retornada pelo WhatsApp.",
              "example": "5m0s"
            }
          }
        }
      }
    }
  },
  "400": {
    "description": "JID inválido",
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "error": {
              "type": "string",
              "example": "invalid newsletter jid"
            }
          }
        }
      }
    }
  },
  "401": {
    "description": "Instância não autenticada ou cliente não encontrado",
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "error": {
              "type": "string",
              "example": "client not found"
            }
          }
        }
      }
    }
  },
  "500": {
    "description": "Erro interno ao assinar updates",
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "error": {
              "type": "string",
              "example": "connection closed"
            }
          }
        }
      }
    }
  }
}
```

## Guias relacionados

[Autenticação](/docs/authentication) · [Erros e retries](/docs/errors-and-retries) · [Server URL](/docs/server-url)
