Subscribe channel (ENTERPRISE)
curl --request GET \
--url https://api.omni.z-api.io/v1/channels/{channelId}/subscribe \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omni.z-api.io/v1/channels/{channelId}/subscribe"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omni.z-api.io/v1/channels/{channelId}/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.omni.z-api.io/v1/channels/{channelId}/subscribe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.omni.z-api.io/v1/channels/{channelId}/subscribe"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.omni.z-api.io/v1/channels/{channelId}/subscribe")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omni.z-api.io/v1/channels/{channelId}/subscribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"type": "SUBSCRIPTION_UPDATED",
"message": "Channel active. Prorated charge will be included in the next invoice."
}
Channels
Subscribe channel
Add a channel to an existing subscription after payment is completed in the dashboard
GET
/
v1
/
channels
/
{channelId}
/
subscribe
Subscribe channel (ENTERPRISE)
curl --request GET \
--url https://api.omni.z-api.io/v1/channels/{channelId}/subscribe \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omni.z-api.io/v1/channels/{channelId}/subscribe"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omni.z-api.io/v1/channels/{channelId}/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.omni.z-api.io/v1/channels/{channelId}/subscribe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.omni.z-api.io/v1/channels/{channelId}/subscribe"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.omni.z-api.io/v1/channels/{channelId}/subscribe")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omni.z-api.io/v1/channels/{channelId}/subscribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"type": "SUBSCRIPTION_UPDATED",
"message": "Channel active. Prorated charge will be included in the next invoice."
}
Overview
Links a channel to the account’s active Stripe subscription. The channel is automatically added to the existing subscription and a prorated charge for the remaining billing period is included on the next invoice.Payment is completed beforehand by the user in the dashboard. This endpoint should be called after the checkout is completed in the dashboard to activate the channel via API.
Example response:
{
"type": "SUBSCRIPTION_UPDATED",
"message": "Channel active. Prorated charge will be included on the next invoice."
}
The
channelId is obtained from the Create channel endpoint.Authorizations
Secret Key generated in the Omni Z-API Security panel
Path Parameters
Channel ID (obtained via Create channel)
Example:
"019E4C54B1B375A28970B605CA9B03C3"
Response
Channel linked to subscription successfully