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

# Join newsletter

> Subscribes the account to an existing newsletter

**Auth:** `TokenAccount` or `TokenInstance` • **Rate-limit:** `Global` (100/min) • **Idempotent:** partial (an already-followed newsletter is usually a silent no-op)

## Description

Subscribes (follows) the account to a newsletter. After `join`, the newsletter shows up on [`GET /list`](/en/api/newsletter/list) and incoming messages arrive as `message.exchange` with `chat.type = "newsletter"`.

## Examples

### By JID

Subscribes the account by passing the canonical newsletter JID (`@newsletter`). It's the most direct format, no need to resolve a link or code first.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/newsletter/join/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "identifier": "120363422585881117@newsletter"
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/newsletter/join/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      identifier: "120363422585881117@newsletter"
    })
  });
  ```

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

  requests.post(
      f"https://ryzeapi.cloud/api/newsletter/join/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "identifier": "120363422585881117@newsletter"
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "identifier": "120363422585881117@newsletter"
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/newsletter/join/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### By link

Subscribes the account by passing the full invite link (`https://whatsapp.com/channel/...`). The server extracts the code from the URL suffix and resolves the JID before following.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/newsletter/join/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "identifier": "https://whatsapp.com/channel/120363422585881117"
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/newsletter/join/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      identifier: "https://whatsapp.com/channel/120363422585881117"
    })
  });
  ```

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

  requests.post(
      f"https://ryzeapi.cloud/api/newsletter/join/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "identifier": "https://whatsapp.com/channel/120363422585881117"
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "identifier": "https://whatsapp.com/channel/120363422585881117"
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/newsletter/join/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### By code

Subscribes the account by passing only the invite code (link suffix, without the domain). A shortcut for when you've already extracted the code.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/newsletter/join/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "identifier": "120363422585881117"
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/newsletter/join/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      identifier: "120363422585881117"
    })
  });
  ```

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

  requests.post(
      f"https://ryzeapi.cloud/api/newsletter/join/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "identifier": "120363422585881117"
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "identifier": "120363422585881117"
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/newsletter/join/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Success response

The response always returns the canonical newsletter JID in `channelJid`, even when the input was a link or invite code. Use that value as the `identifier` in subsequent calls (`/info`, `/leave`).

```json 200 OK theme={null}
{
  "success": true,
  "message": "Successfully joined newsletter",
  "channelJid": "120363422585881117@newsletter"
}
```

## Path parameters

<ParamField path="instance" type="string" required>
  Instance name.
</ParamField>

## Headers

<ParamField header="token" type="string" required>
  `TokenAccount` or `TokenInstance`.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Request body

<ParamField body="identifier" type="string" required>
  `@newsletter` JID, full link or invite code.
</ParamField>

## Notes

<Note>
  * The response always returns the **canonical JID** in `channelJid`, useful when the input was a link / code.
  * After `join`, the propagation to `GET /list` can take a few seconds.
  * In rare cases, private newsletters require approval from the owner, `join` returns success but the newsletter only shows up in `list` after the approval.
  * Invite links can be revoked by the owner, old codes start failing with `newsletter not found`.
</Note>

## Errors

| HTTP | Message                                                                    |
| ---- | -------------------------------------------------------------------------- |
| 400  | `The 'identifier' field is required (JID @newsletter or invite link/code)` |
| 400  | `Invalid newsletter identifier (use JID @newsletter or invite link/code)`  |
| 400  | `newsletter not found`                                                     |
| 500  | `failed to follow newsletter: <reason>`                                    |
| 501  | `WhatsApp client does not support FollowNewsletter`                        |

Envelope:

```json theme={null}
{
  "success": false,
  "error": { "message": "newsletter not found" }
}
```
