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

# Send Channel Admin Invite

> Invite a contact to become an admin of your WhatsApp Channel.

## Endpoint

POST `https://api.wapimax.com/whatsapp/v1/sessions/{session_id}/messages/newsletter-admin-invite`

## Authentication

Every request must include your API key in the `X-API-Key` header. See [Authorization](https://docs.wapimax.com/get-started/authorization.md) to create one.

| Header | Value | Required |
| - | - | - |
| `X-API-Key` | Your WapiMax API key | Yes |
| `Content-Type` | `application/json` | Yes |

## Path parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `session_id` | string | Yes | Session used to send the message |

## Body parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `to` | string | Yes | Recipient ID, for example `254712345678@s.whatsapp.net` |
| `newsletter_jid` | string | Yes | Channel ID, for example `120363000000000000@newsletter` |
| `newsletter_name` | string | Yes | Channel name |
| `caption` | string | No | Invite message |
| `invite_expiration` | integer | No | Invite expiry time, Unix seconds |
| `reply_to` | string | No | ID of the message to reply to |
| `send_at` | string | No | Scheduled send time, ISO 8601 UTC |

## Request

```bash cURL theme={null}
curl -X POST "https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/newsletter-admin-invite" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "to": "254712345678@s.whatsapp.net",
    "newsletter_jid": "120363000000000000@newsletter",
    "newsletter_name": "WapiMax Updates",
    "caption": "We would like you to help manage our channel.",
    "invite_expiration": 1795000000
  }'
```

```javascript JavaScript theme={null}
const response = await fetch("https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/newsletter-admin-invite", {
  method: "POST",
  headers: {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
    "Accept": "application/json"
  },
  body: JSON.stringify({
    to: "254712345678@s.whatsapp.net",
    newsletter_jid: "120363000000000000@newsletter",
    newsletter_name: "WapiMax Updates",
    caption: "We would like you to help manage our channel.",
    invite_expiration: 1795000000
  })
});

const data = await response.json();
console.log(data);
```

```javascript Node.js theme={null}
// Node.js 18 or later
const response = await fetch("https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/newsletter-admin-invite", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.WAPIMAX_API_KEY,
    "Content-Type": "application/json",
    "Accept": "application/json"
  },
  body: JSON.stringify({
    to: "254712345678@s.whatsapp.net",
    newsletter_jid: "120363000000000000@newsletter",
    newsletter_name: "WapiMax Updates",
    caption: "We would like you to help manage our channel.",
    invite_expiration: 1795000000
  })
});

if (!response.ok) {
  throw new Error(`Request failed with status ${response.status}`);
}

console.log(await response.json());
```

```php PHP theme={null}
<?php

$curl = curl_init();

$payload = json_encode([
    "to" => "254712345678@s.whatsapp.net",
    "newsletter_jid" => "120363000000000000@newsletter",
    "newsletter_name" => "WapiMax Updates",
    "caption" => "We would like you to help manage our channel.",
    "invite_expiration" => 1795000000
]);

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/newsletter-admin-invite",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => $payload,
    CURLOPT_HTTPHEADER => [
        "X-API-Key: YOUR_API_KEY",
        "Content-Type: application/json",
        "Accept: application/json"
    ]
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;
```

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

response = requests.post(
    "https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/newsletter-admin-invite",
    headers={
        "X-API-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
        "Accept": "application/json"
    },
    json={
        "to": "254712345678@s.whatsapp.net",
        "newsletter_jid": "120363000000000000@newsletter",
        "newsletter_name": "WapiMax Updates",
        "caption": "We would like you to help manage our channel.",
        "invite_expiration": 1795000000
    }
)

print(response.json())
```

```java Java theme={null}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        String json = """
            {
              "to": "254712345678@s.whatsapp.net",
              "newsletter_jid": "120363000000000000@newsletter",
              "newsletter_name": "WapiMax Updates",
              "caption": "We would like you to help manage our channel.",
              "invite_expiration": 1795000000
            }
            """;

        HttpClient client = HttpClient.newHttpClient();

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/newsletter-admin-invite"))
            .header("X-API-Key", "YOUR_API_KEY")
            .header("Content-Type", "application/json")
            .header("Accept", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(json))
            .build();

        HttpResponse<String> response = client.send(
            request,
            HttpResponse.BodyHandlers.ofString()
        );

        System.out.println(response.body());
    }
}
```

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

import (
    "bytes"
    "fmt"
    "io"
    "net/http"
)

func main() {
    jsonBody := []byte(`{
  "to": "254712345678@s.whatsapp.net",
  "newsletter_jid": "120363000000000000@newsletter",
  "newsletter_name": "WapiMax Updates",
  "caption": "We would like you to help manage our channel.",
  "invite_expiration": 1795000000
}`)

    req, _ := http.NewRequest(
        "POST",
        "https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/newsletter-admin-invite",
        bytes.NewBuffer(jsonBody),
    )

    req.Header.Set("X-API-Key", "YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Accept", "application/json")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
```

```ruby Ruby theme={null}
require "net/http"
require "uri"
require "json"

uri = URI("https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/newsletter-admin-invite")

request = Net::HTTP::Post.new(uri)
request["X-API-Key"] = "YOUR_API_KEY"
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request.body = {
  to: "254712345678@s.whatsapp.net",
  newsletter_jid: "120363000000000000@newsletter",
  newsletter_name: "WapiMax Updates",
  caption: "We would like you to help manage our channel.",
  invite_expiration: 1795000000
}.to_json

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
```

```csharp C# theme={null}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();

        client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
        client.DefaultRequestHeaders.Add("Accept", "application/json");

        var payload = new
        {
            to = "254712345678@s.whatsapp.net",
            newsletter_jid = "120363000000000000@newsletter",
            newsletter_name = "WapiMax Updates",
            caption = "We would like you to help manage our channel.",
            invite_expiration = 1795000000
        };

        var content = new StringContent(
            JsonSerializer.Serialize(payload),
            Encoding.UTF8,
            "application/json"
        );

        var response = await client.PostAsync(
            "https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/newsletter-admin-invite",
            content
        );

        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
```

```swift Swift theme={null}
import Foundation

let url = URL(string: "https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/newsletter-admin-invite")!

var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "X-API-Key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.setValue("application/json", forHTTPHeaderField: "Accept")

let body: [String: Any] = [
    "to": "254712345678@s.whatsapp.net",
    "newsletter_jid": "120363000000000000@newsletter",
    "newsletter_name": "WapiMax Updates",
    "caption": "We would like you to help manage our channel.",
    "invite_expiration": 1795000000
]

request.httpBody = try? JSONSerialization.data(withJSONObject: body)

URLSession.shared.dataTask(with: request) { data, _, error in
    if let error = error {
        print(error)
        return
    }

    if let data = data {
        print(String(data: data, encoding: .utf8) ?? "")
    }
}.resume()
```

```kotlin Kotlin theme={null}
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody

fun main() {
    val client = OkHttpClient()

    val json = """
        {
          "to": "254712345678@s.whatsapp.net",
          "newsletter_jid": "120363000000000000@newsletter",
          "newsletter_name": "WapiMax Updates",
          "caption": "We would like you to help manage our channel.",
          "invite_expiration": 1795000000
        }
    """.trimIndent()

    val request = Request.Builder()
        .url("https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/newsletter-admin-invite")
        .post(json.toRequestBody("application/json".toMediaType()))
        .addHeader("X-API-Key", "YOUR_API_KEY")
        .addHeader("Content-Type", "application/json")
        .addHeader("Accept", "application/json")
        .build()

    client.newCall(request).execute().use { response ->
        println(response.body?.string())
    }
}
```

## Response

```json Sent theme={null}
{
  "status": "sent",
  "message_id": "3EB0C8F1A2B3C4D5E6",
  "timestamp": 1794304083,
  "to": "254712345678@s.whatsapp.net"
}
```

```json Scheduled theme={null}
{
  "status": "pending",
  "schedule_id": "b3f1c2a4-1234-4cde-9f00-abcdef123456",
  "send_at": "2026-12-01T12:00:00Z"
}
```

### Response fields

| Field | Type | Description |
| - | - | - |
| `status` | string | `sent` or `pending` |
| `message_id` | string | Sent message ID |
| `timestamp` | integer | Sent time (Unix) |
| `to` | string | Recipient ID |
| `schedule_id` | string | Scheduled message ID |
| `send_at` | string | Scheduled send time |

## Errors

| Status | Description |
| - | - |
| `400` | Invalid request or parameters |
| `401` | Missing or invalid API key |
| `403` | Access to this session is not allowed |
| `404` | Session or resource not found |
| `429` | Rate limit or quota exceeded |
| `503` | Session is not connected |


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